How to install ISPConfig 3 on Ubuntu 16.04

How to install ISPConfig 3 on Ubuntu 16.04

In this tutorial, we will show you how to install ISPConfig 3 on Ubuntu 16.04. ISPConfig is an open source hosting control panel which is very fast, secure and stable. It is used by many system admins to manage their servers via a web-based interface instead of using the command line. It comes with support for many services including Apache, Nginx, MySQL, Bind, Postfix, Dovecot, Courier, PureFTPD etc. and it is used for easy website administration, creating email accounts and FTP users, creating MySQL databases, setting up cron jobs, DNS administration and more. Installing ISPConfig 3 on Ubuntu 16.04, is an easy task if you carefully follow our tutorial below.

1. Connect via SSH and update the system software

First of all, connect to your server via SSH and upgrade the system software to the latest version. You can use the following commands for that purpose:

sudo apt-get update
sudo apt-get upgrade

2. Disable Apparmor

Also, make sure that Apparmor is not running on your server. You can disable it and remove it completely from your server by using the commands below:

sudo systemctl stop apparmor.service
sudo apt-get remove apparmor apparmor-utils

3. Install required packages

Next, we need to install some required packages. Go ahead and install the following packages:

sudo apt-get install openssl apache2 apache2-utils apache2-doc libapache2-mod-php php7.0 php7.0-common php7.0-cli php7.0-mysql php7.0-sqlite3 php7.0-imap php7.0-gd php7.0-cgi php7.0-zip php7.0-mbstring php7.0-opcache php7.0-curl php7.0-intl php7.0-pspell php7.0-recode php7.0-tidy php7.0-xmlrpc php7.0-xsl libapache2-mod-fcgid php-auth apache2-suexec-pristine php-pear php7.0-mcrypt mcrypt imagemagick libruby memcached php-memcache php-imagick libapache2-mod-python php-gettext php-apcu mariadb-server mariadb-client phpmyadmin postfix postfix-mysql postfix-doc dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve dovecot-lmtpd postgrey amavisd-new spamassassin clamav clamav-daemon clamav-docs mailman roundcube roundcube-core roundcube-mysql roundcube-plugins roundcube-plugins-extra php-net-sieve tinymce getmail4 javascript-common libjs-jquery-mousewheel rkhunter binutils zoo zip unzip bzip2 vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl bind9 dnsutils haveged daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl quota quotatool libnet-dns-perl pure-ftpd-common pure-ftpd-mysql cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl arj nomarch lzop

Some of these packages may be required for special configurations, but we will install them in any case.
Configure memcached to listen on localhost (127.0.0.1) and disable UDP:

vi /etc/memcached.conf
-l 127.0.0.1
-U 0

During the installation, you will need to answer some basic questions. When installing the Postfix service you will be asked to select configuration. Select Internet Site. Next, as system mail name enter your server hostname. If you are asked to select a web server, select Apache2.
Also, you will be asked to enter MySQL application password for phpMyadmin and MySQL application password for Roundcube. You can enter a strong password of your choice.

4. Configure Apache and PHP

Once the installation of the required packages is completed, it is time to configure the software. Let’s start with Apache. Enable the following Apache and PHP modules:

sudo a2enmod rewrite ssl cgi include actions suexec dav_fs dav auth_digest alias
sudo phpenmod mcrypt

5. Restart Apache Server

Then, restart the Apache service for the changes to take effect:

sudo systemctl restart apache2.service

6. Configured is pure-ftpd

Another service that needs to be configured is pure-ftpd. Since you will have to provide the users with FTP access to your Ubuntu VPS so they can upload and download files, you need to configure chroot environment. That way, the users will not have access to the rest of the system. Edit the /etc/default/pure-ftpd-common file and change the value for VIRTUALCHROOT from false to true.

sudo nano /etc/default/pure-ftpd-common

VIRTUALCHROOT=true

You can also set up an SSL certificate in order to secure your FTP service.

Restart the service for the changes to take effect:

sudo systemctl restart pure-ftpd-mysql.service

7. Configure Posfix and Mailman

Next we can configure Posfix and Mailman. Edit the Postfix master configuration file:

sudo nano /etc/postfix/master.cf

Basically, we will need to uncomment a few lines in the configuration file and append -o smtpd_client_restrictions=permit_sasl_authenticated,reject under the submission and smtps sections. The file should look like the following:

submission inet n       -       y       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING

smtps     inet  n       -       y       -       -       smtpd
  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING

8. Create new list for Mailman

Save and close the file. Then we can create a new list for Mailman.

sudo newlist mailman

You will be asked to enter an email of the person that runs the list as well as a password. The script will provide you with output of aliases which should be added to the /etc/aliases file.

sudo nano /etc/aliases

The file should be similar like the following:

# Required aliases
postmaster:     root
MAILER-DAEMON:  postmaster

# Common aliases
abuse:          postmaster
spam:           postmaster

# Other aliases
clamav: root

mailman:              "|/var/lib/mailman/mail/mailman post mailman"
mailman-admin:        "|/var/lib/mailman/mail/mailman admin mailman"
mailman-bounces:      "|/var/lib/mailman/mail/mailman bounces mailman"
mailman-confirm:      "|/var/lib/mailman/mail/mailman confirm mailman"
mailman-join:         "|/var/lib/mailman/mail/mailman join mailman"
mailman-leave:        "|/var/lib/mailman/mail/mailman leave mailman"
mailman-owner:        "|/var/lib/mailman/mail/mailman owner mailman"
mailman-request:      "|/var/lib/mailman/mail/mailman request mailman"
mailman-subscribe:    "|/var/lib/mailman/mail/mailman subscribe mailman"
mailman-unsubscribe:  "|/var/lib/mailman/mail/mailman unsubscribe mailman"

Save and close the file. Initialize the alias database and restart the services.

sudo newaliases
sudo systemctl restart mailman.service
sudo systemctl restart postfix.service

9. Disable SpamAssassin

Additionally, you need to stop and disable SpamAssassin.

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer
NVME 2 VPS

Now just $43 .99
/mo

GET YOUR VPS
sudo systemctl stop spamassassin.service
sudo systemctl disable spamassassin.service

Next, remove the /etc/cron.d/awstats file:

sudo rm -f /etc/cron.d/awstats

10. Install ISPConfig on Ubuntu 16.04

Finally, let’s install ISPConfig. Download the latest release and install it by using the following commands:

cd /tmp 
sudo wget -O ispconfig.tar.gz https://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=stable-3.1
sudo tar xfz ispconfig.tar.gz
cd ispconfig3*/install/
sudo php -q install.php

Answer the questions to complete the installation and then access the ISPConfig hosting control panel at:

https://IP-ADDRESS:8080

You need to replace IP-ADDRESS with your server IP address. Alternatively, you can use a domain name that points to your server IP address. To log in you need to use admin as username and the password you set up during the installation process. Once you log in you should see something like the following.

install ISPConfig 3 on Ubuntu 16.04

Of course, you don’t have to install ISPConfig 3 on Ubuntu 16.04, if you use one of our  Ubuntu 16.04 VPS Hosting services, in which case you can simply ask our expert Linux admins to install ISPConfig on Ubuntu 16.04, for you. They are available 24×7 and will take care of your request immediately. You might also want to read our guide on How to Install ISPConfig 3 on Ubuntu 18.04.

PS. If you liked this post on how to install ISPConfig 3 on Ubuntu 16.04,  please share it with your friends on the social networks using the buttons or simply leave a reply below. Thanks.

9 thoughts on “How to install ISPConfig 3 on Ubuntu 16.04”

  1. Did not work for me. Up to this point (Enable the following Apache and PHP modules): I could access apache2 (http://192.168.0.100), but after that no more:

    $ systemctl status apache2.service
    ● apache2.service – LSB: Apache2 web server
    Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
    Drop-In: /lib/systemd/system/apache2.service.d
    └─apache2-systemd.conf
    Active: inactive (dead) since Fri 2017-10-27 15:40:13 BRST; 4min ago
    Docs: man: systemd-sysv-generator (8)
    Process: 7984 ExecStop = / etc / init.d / apache2 stop (code = exited, status = 0 / SUCCESS)
    Process: 7961 ExecStart = / etc / init.d / apache2 start (code = exited, status = 0 / SUCCESS)

    Oct 27 15:40:13 server apache2 [7961]: (98) Address already in use: AH00072: make_sock: could not bind to address [::]: 443
    Oct 27 15:40:13 server apache2 [7961]: (98) Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443
    Oct 27 15:40:13 apache2 server [7961]: no listening sockets available, shutting down
    Oct 27 15:40:13 apache2 server [7961]: AH00015: Unable to open logs
    Oct 27 15:40:13 server apache2 [7961]: Action ‘start’ failed.
    Oct 27 15:40:13 apache2 server [7961]: The Apache error log may have more information.
    Oct 27 15:40:13 apache2 server [7961]: *
    Oct 27 15:40:13 apache2 server [7984]: * Stopping Apache httpd web server apache2
    Oct 27 15:40:13 apache2 server [7984]: *
    Oct 27 15:40:13 systemd server [1]: Started LSB: Apache2 web server.

    Reply
    • According to the error message you get

      Address already in use: AH00072: make_sock: could not bind to address [::]: 443
      Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443

      port 443 is already used by another service. Please stop the service running on port 443 and restart Apache again.

      Thanks.

      Reply
  2. This morning I am getting errors like this:
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package libnet-dns-perl is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    Package daemon is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    followed by 20-30 of these kinds: E: Package ‘libapache2-mod-fcgid’ has no installation candidate
    E: Package ‘php-auth’ has no installation candidate
    E: Unable to locate package mcrypt
    E: Unable to locate package libruby….

    Any ideas?

    Reply
  3. Thanks, it turns out we had a corruption on the server. The /etc/apt/sources.list was screwed up.

    Then I got this error which I resolved the following way, per https://stackoverflow.com/questions/48363789/warning-module-mcrypt-ini-file-doesnt-exist-under-etc-php-7-2-mods-available

    root@hquapp33:/home/nazadmin# phpenmod mcrypt
    WARNING: Module mcrypt ini file doesn’t exist under /etc/php/7.2/mods-available
    WARNING: Module mcrypt ini file doesn’t exist under /etc/php/7.2/mods-available
    WARNING: Module mcrypt ini file doesn’t exist under /etc/php/7.2/mods-available
    root@hquapp33:/home/nazadmin# sudo ln -s /etc/php/7.0/mods-available/mcrypt.ini /etc/php/7.2/mods-available/
    root@hquapp33:/home/nazadmin# phpenmod mcrypt
    root@hquapp33:/home/nazadmin#

    Then I kept going. Then I got an error on the ISPConfig install:

    =====================
    *******************************
    =====================
    root@hquapp33:/tmp# sudo tar xfz ispconfig.tar.gz
    root@hquapp33:/tmp# cd ispconfig3*/install/
    root@hquapp33:/tmp/ispconfig3-stable-3.1-87c0dde9b1b19600f4a6ecf32659601fe3859c05/install# sudo php -q install.php
    PHP Warning: PHP Startup: Unable to load dynamic library ‘mcrypt.so’ (tried: /usr/lib/php/20170718/mcrypt.so (/usr/lib/php/20170718/mcrypt.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/mcrypt.so.so (/usr/lib/php/20170718/mcrypt.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

    ——————————————————————————–
    _____ ___________ _____ __ _ ____
    |_ _/ ___| ___ \ / __ \ / _(_) /__ \
    | | \ `–.| |_/ / | / \/ ___ _ __ | |_ _ __ _ _/ /
    | | `–. \ __/ | | / _ \| ‘_ \| _| |/ _` | |_ |
    _| |_/\__/ / | | \__/\ (_) | | | | | | | (_| | ___\ \
    \___/\____/\_| \____/\___/|_| |_|_| |_|\__, | \____/
    __/ |
    |___/
    ——————————————————————————–

    >> Initial configuration

    Operating System: Ubuntu 16.04.4 LTS (Xenial Xerus)

    Following will be a few questions for primary configuration so be careful.
    Default values are in [brackets] and can be accepted with .
    Tap in “quit” (without the quotes) to stop the installer.

    Select language (en,de) [en]:

    Installation mode (standard,expert) [standard]:

    Full qualified hostname (FQDN) of the server, eg server1.domain.tld [hquapp33.nazarene.org]:

    No PHP MySQLi functions available. Please ensure that the PHP MySQL module is loaded.root@hquapp33:/tmp/ispconfig3-stable-3.1-87c0dde9b1b19600f4a6ecf32659601fe3859c05/install#
    =====================
    *******************************
    =====================

    So I gave up at that point as asked for assistance.

    Since there is an issue with mcrypt and …something else (mbstring?) that are now deprecated and no longer work with ISPConfig, we are limited to using PHP 7.0, as the instructions above specify. However, because of an error in the server it was corrected with too-aggressive updates that forced it to be 7.2 before I got to it and performed this procedure.

    There was a lot wrong on our end. It took someone who knew what they were doing 4 hours to get to the bottom of this, which I have summarized

    Reply

Leave a Comment