Operating System Debian

How to Install the AlternC Hosting Control Panel on Debian 12 (Bookworm)

Install AlternC 3.5 on Debian 12 from the project's APT repository, run alternc.install, log in for the first time and add webmail, statistics and Let's Encrypt add-ons.

AlternC is a free web and mail hosting control panel built as a set of Debian packages. It configures Apache, PHP, MariaDB, Postfix, Dovecot, ProFTPD and BIND and gives each hosted account a web interface for domains, mailboxes, FTP users and databases. This guide installs AlternC 3.5 from the project's own APT repository on Debian 12 "Bookworm", which is the only release the AlternC team actively tests and supports. Debian Squeeze, Wheezy and Jessie are long out of support, and the AlternC repository tells users of anything older than Buster to upgrade.

Why Debian 12 and not Debian 13

Debian 13 "Trixie" is the current stable release, but AlternC does not publish a supported build for it yet. The repository page states that support is provided only for Bookworm with AlternC 3.5 or later; Bullseye packages exist solely to let Buster systems upgrade. The packages also depend on Bookworm's PHP 8.2. Install on a fresh Debian 12 server and do not mix in packages from other releases.

Requirements

  • A clean Debian 12 server used only for AlternC. The installer rewrites the configuration of Apache, Postfix, Dovecot, BIND and ProFTPD, so do not run it on a machine that already hosts sites or mail.
  • Root access. The commands below are run as root (su - or sudo -i).
  • A fully qualified host name for the panel, such as panel.example.com, pointing to the server. Do not use a domain you intend to host as a customer site.
  • The line @includedir /etc/sudoers.d in /etc/sudoers (present by default on Debian 12; check with visudo).

Step 1: Prepare the system

Update the server and install the tools the repository setup needs:

apt update
apt -y upgrade
apt -y install wget lsb-release ca-certificates

Set the host name the panel will use:

hostnamectl set-hostname panel.example.com

Step 2: Enable ACLs and quotas (optional but recommended)

AlternC uses POSIX ACLs on the partition that holds account data and uses group quotas to limit disk space per account. ext4 enables ACLs by default; make sure the mount options in /etc/fstab do not contain noacl. For quotas, install the tools and add grpquota to the options of that partition:

apt -y install quota
# /etc/fstab example for the root file system
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  /  ext4  errors=remount-ro,acl,grpquota  0  1
mount -o remount,acl,grpquota /

Some virtual servers do not allow quota options on the root file system. In that case skip this step; AlternC then treats web space as unlimited.

Step 3: Install the database server

AlternC needs a local MySQL-compatible server and its administrator account before the panel packages are configured. On Debian 12 that is MariaDB:

apt -y install mariadb-server
mysql_secure_installation

Set a root password when asked and keep it at hand: the AlternC and phpMyAdmin configuration dialogs ask for it. The AlternC documentation suggests storing it in /root/.my.cnf so that the mysql client connects without a prompt:

[client]
user=root
password=YourDatabaseRootPassword
chmod 600 /root/.my.cnf

Step 4: Add the AlternC repository

Download the signing key into a keyring file and reference it explicitly; apt-key, used in older instructions, is no longer available. The repository does not accept aliases such as stable, so the release code name is written into the source line:

wget https://debian.alternc.org/key.txt -O /usr/share/keyrings/alternc.asc
echo "deb [signed-by=/usr/share/keyrings/alternc.asc] https://debian.alternc.org/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/alternc.list
apt update

Check that the candidate version comes from debian.alternc.org:

apt-cache policy alternc

Step 5: Install AlternC

apt install alternc

This pulls in Apache with mpm-itk, PHP, Postfix, Dovecot, ProFTPD, BIND, OpenDKIM and phpMyAdmin. Since version 3.5 the former alternc-ssl package is part of the core package. During installation you answer several dialogs:

  • Panel host name: the fully qualified name from the requirements, or the server's IP address.
  • Name servers: two DNS servers for hosted domains. Use your own host names, typically the server itself as primary.
  • Postfix: choose Internet Site and enter the server's fully qualified domain name.
  • phpMyAdmin: accept the database configuration and give the MariaDB administrator password.

When the packages are installed, run the script that generates every service configuration from AlternC's templates. This step is mandatory, and you run it again after changing AlternC settings or installing an AlternC add-on:

alternc.install

Step 6: First login

Open the panel at the host name you configured, for example https://panel.example.com/. Until you install a real certificate the browser warns about the self-signed one. Log in with the user admin and the password admin, then change the password straight away in the account settings menu. From the administrator account you create member accounts, set quotas and add domains.

Optional add-ons

The same repository carries optional packages. Install the ones you need and run alternc.install again:

apt install alternc-roundcube alternc-awstats alternc-acme
alternc.install
  • alternc-roundcube: Roundcube webmail for hosted mailboxes.
  • alternc-awstats: AWStats web statistics.
  • alternc-acme: Let's Encrypt certificates through Certbot for the panel and hosted domains.
  • alternc-mailman: mailing lists based on Mailman 3.

Firewall and maintenance

A hosting server has to accept SSH (22), DNS (53 TCP and UDP), HTTP and HTTPS (80, 443), SMTP and submission (25, 465, 587), IMAP and POP3 (143, 993, 110, 995) and FTP (21 plus the passive port range configured in ProFTPD). Open only what you actually offer.

AlternC updates arrive through normal apt upgrades; run alternc.install after an AlternC package has been upgraded. Back up the alternc database, /etc/alternc and the account data directory together. See the AlternC Debian repository page and the installation guide for the project's current instructions.

Frequently asked questions

Is the easy-install script from GitHub still the way to install AlternC?

Older tutorials clone the easy-install repository and run install.sh. The project's repository page now documents the plain APT method shown here, which is only three commands once the repository is added, and it is the route that is kept current for Bookworm.

Can I install AlternC on Ubuntu?

AlternC is packaged and tested for Debian only. The package dependencies match Debian's PHP and service packages, so use Debian 12.

I am upgrading an old AlternC 3.1 to 3.3 server. Anything to watch for?

Yes. The project recommends upgrading to 3.3.12 first and then to 3.5, because 3.5 merges alternc-ssl into the core package and a direct jump can mark SSL sub-domain types for deletion. Read the upgrade section of the AlternC README and back up the database before starting.

Share story:

Continue reading other guides on How VPS.