In this tutorial, we will show you how to set up and install ISPConfig 3 on a VPS running Ubuntu 18.04.
ISPConfig is a well-known open-source web hosting control panel that allow us to manage services through a web browser. We can easily add Apache virtual host or Nginx server blocks, create/edit/delete databases, configure cron jobs, create email accounts, and much more. It is a free alternative to paid control panels – you don’t have to spend any money to use this control panel.
Table of Contents
Prerequisites:
- An Ubuntu 18.04 VPS
- SSH access with root privileges
Step 1: Log in via SSH and Update the System
Log in to your Ubuntu 18.04 VPS with SSH as a root user, or a user with sudo privileges:
Replace IP_Address and Port_number with their respective values for your server.
You can check whether you have the proper Ubuntu version installed on your server with the following command:
You should get this output:
Then, run the following command to make sure that all installed packages on the server are updated to the latest available version:
In this tutorial, we will use ubuntu.mydomain.com as the server hostname – a hostname should be an FQDN (a Fully Qualified Domain Name). It is important to use a subdomain as the hostname, and not the main domain. If you do not use a subdomain for the server hostname, you will for example have an issue with amavis
and other emailing related programs. Learn more on how to change your hostname.
Step 2: Reconfigure Bash and Stop the ‘apparmor’ Program
We need to use bash as the default system shell, not dash, to proceed with the ISPConfig installation.
Check if you have services running on your server already:
Step 3: Install MariaDB, Postfix, and Dovecot
Run the folowing commands to install MariaDB, Postfix, and Dovecot.
In the installation process, you will be asked two questions for postfix – make sure you use your hostname as the system mail name.
Next, edit /etc/postfix/master.cf
using your preferred text editor.
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 smtpd sections. The file should look like the following:
When done, save and exit the file and restart Postfix:
At this point, MariaDB is running and we are now going to create a password for the root user. Run the following command to create a root password, remove the test database, remove the anonymous user then reload the privileges.
Once created, you can test the password by invoking this command. You will be asked for the root password that you set in the previous command:
Step 4: Install Spamassassin, Clamav and Amavisd-new
Run the next line to install Spamassassin, Clamav, and Amavisd-new, as well as some required packages for these programs to work properly.
To free some memory usage, we can stop spamassassin. ISPConfig 3 uses amavisd, which loads the Spamassassin libraries internally, so we can stop spamassassin.
If you see the error message when running ‘freshclam’ command as shown below, you can ignore it as this means that freshclam is already running:
At the time of this article being written, the amavisd-new has a bug in Ubuntu 18.04 that needs to be patched. To fix it, run the following commands:
You will see the following message. But, if you see an error message, it means that amavisd-new has already been patched.
Step 5: Install Apache and Other Packages
Run the next command to install the packages required by ISPConfig. It’s likely that at least a few of these will already be installed on your system.
During the installation, you will need to answer some basic questions. If you are asked to select a web server, select Apache2.
Also, you will be asked to enter the MySQL application password for phpMyAdmin and the MySQL application password for Roundcube. You can enter a strong password of your choice or leave them blank to make the system create random passwords for them. Ideally, you would create the password so you can know what the password is.
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:
We also need to configure Roundcube webmail to prevent it from showing server name input in the webmail login form.
Edit the ‘default_host’ value to ‘localhost’
Save the file, then exit.
Configure 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 a 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.
Save the file and exit, then restart the service for the changes to take effect:
Create a New List for Mailman
We can create a new list for Mailman now.
You will be asked to enter the email of the person that runs the list as well as a password. The script will provide you with an output of aliases that should be added to the /etc/aliases
file.
The file should be like the following:
Save and close the file. Initialize the alias database and restart the services.
Disable awstats cron
We need to comment out all lines in that file by appending “#” in front of the lines, it should be like this:
Step 6: Install Fail2Ban
You can skip this step, but for security purpose it is recommended to have Fail2Ban running on your server. This temporarily bans the IP addresses of computers that attempt to log in through SSH too many times. Run this command to install it:
Once installed, use your preferred text editor to edit the configuration file for Fail2Ban.
Step 7: Install Jailkit
If you want to chroot your SSH users, you need to install Jailkit prior to installing ISPConfig.
Now we can install Jailkit with the following command:
Step 8: Install ISPConfig 3
Finally, let’s install ISPConfig. Download the latest release and install it by using the following command.s:
Answer the questions to complete the installation and then access the ISPConfig hosting control panel at: http://yourIPAddress:8080
Congratulations! At this point, you should be able to access ISPConfig at http://yourIPAddress:8080
. For more information about ISPConfig, its features and configuration, please check their official documentation.
Feel free to check out our tutorial on how to install ISPConfig 3 on CentOS 3.
Of course, you don’t have to know how to install ISPConfig on Ubuntu 18.04 if you use our Ubuntu 18.04 VPS Hosting services. You can simply ask our support team to install ISPConfig on Ubuntu 18.04 for you. They are available 24/7, and will be able to help you with the installation of ISPConfig on Ubuntu 18.04.
PS. If you enjoy reading this blog post on installing ISPConfig on Ubuntu 18.04, feel free to share it on social networks, or simply leave a comment down in the comments section. Thank you.
In Step 8
the correct link today for ispconfig
wget https://git.ispconfig.org/ispconfig/ispconfig3/raw/develop/helper_scripts/ubuntu-amavisd-new-2.11.patch
Thanks!
Hi there. Thanks for posting that!
As of today, i’m actually trying to follow your steps but some error came up along the way. Im doing my best to google those errors and figure out why they occur. It would be nice to be able to chat with you. Tommy
Hello,
So I installed ISP config and after I went to the website and i got hmmmm…can’t reach this page. I setup the IP and the domain properly and everything else. I added all the ports to. Please help!
Thank you
You can verify the issue by looking at the log files.