How to Install Vanilla Forums on Ubuntu 18.04

In this tutorial, we will show you how to install Vanilla Forums on a Ubuntu 18.04 VPS.

Vanilla Forums is an open-source multi-lingual forum software written in PHP. It provides all of the features you need to run a successful forum. It’s easy to install and use, and it comes with lots of add-ons and themes to choose from. Let’s begin with the installation.


  • For the purposes of this tutorial, we will be using a Ubuntu 18.04 VPS.
  • You will also need a working LAMP or LEMP (Linux, Apache/Nginx, MySQL/MariaDB, PHP) stack. We will also show you how to install your own LAMP stack as a part of this tutorial.
  • Full SSH root access or a user with sudo privileges is also required.

Step 1: Connect to Your Server

Before we begin, you will need to connect to your server via SSH as the root user or as any other user that has sudo privileges.

To connect to your server as the root user, use the following command:


Make sure to replace IP_ADDRESS and PORT_NUMBER with your actual server IP address and SSH port number.

Once logged in, make sure that your server is up-to-date by running the following commands:

sudo apt-get update
sudo apt-get upgrade

Step 2: Install LAMP

Before we proceed with the Vanilla Forums installation, we will need to prepare our server and set up a LAMP stack. If you already have a working LAMP setup installed on your server, you can skip this step and go ahead to the next step of this tutorial.

To install the Apache web server, run the following command:

sudo apt install apache2

Once the installation is complete, enable the Apache service to start automatically upon system boot. You can do that with the following command:

sudo systemctl enable apache2

To verify that Apache is running, execute the following command:

sudo systemctl status apache2

To install the MySQL database server, enter the following command:

sudo apt install mysql-server

During the installation, you will be asked to enter a password for the MySQL root user. Make sure to enter a strong password.

To further improve the security of our MySQL installation as well as set up a password for our MySQL root user, we need to run the mysql_secure_installation script and follow the on-screen instructions. Run the command below to configure your system:

sudo mysql_secure_installation

If the program asks you to enter your current MySQL root password, just press your [Enter] key once, as no password is set by default when installing MySQL.

A few more questions will be displayed on-screen – it is recommended that you answer yes to all of them by entering the character ‘Y’:

Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y

You will also need to enable MySQL and Apache to start on boot with:

sudo systemctl enable apache2
sudo systemctl enable mysql

PHP 7.3 is the recommended version for running Vanilla Forums. However, Ubuntu 18.04 comes with PHP 7.2 by default. Therefore, we will need to manually update PHP to 7.3 or later.

To install PHP 7.3 on your server, first, we need to enable the ondrej/php PPA, by running the following commands:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

You can now install PHP 7.3 along with the other extensions required by Vanilla Forums:

sudo apt install php7.3 libapache2-mod-php7.3 php7.3-common php7.3-mysql php7.3-cli php7.3-opcache php7.3-gd php7.3-curl php7.3-cli php7.3-imap php7.3-mbstring php7.3-soap php7.3-xmlrpc php7.3-xml php7.3-zip

To verify that PHP 7.3 is successfully installed, run the following command:

php -v

You should get the following output on your screen:

PHP (cli) (built: Aug  7 2019 09:52:12) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.8, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache, Copyright (c) 1999-2018, by Zend Technologies

Step 3: Download Vanilla Forums

Now that we have our LAMP stack installed, and we can start with our Vanilla Forums installation and configuration.

First, let’s download the latest stable Vanilla Forums version from this link. At the moment of writing this tutorial, the latest stable version is 3.1. To download this version on your server, you can run the following command. We have added the download link into the command for you:

sudo wget

Let’s extract the files to the /var/www location on our server with this next line:

sudo unzip -d /var/www

Note: If you don’t have the unzip package installed on your server, you can install it with the following command: apt-get install unzip

Remove the downloaded file with:

sudo rm

Rename the extracted directory named package to vanilla with the following command:

sudo mv /var/www/package /var/www/vanilla

The owner of all of these files needs to be the user of the web server running on your system. In our example, we are using the Apache web server and Apache runs as ‘www-data’ user on Ubuntu 18.04.  To change the owner and set the correct permissions for these files, you need to run the following command:

sudo chown -R www-data:www-data /var/www/vanilla

Step 4: Configure the Database

Next, we need to create a new database for our Vanilla Forums application. To do this, log in to your MySQL database server as the root user by typing the following command:

sudo mysql -u root -p

Once you are signed in, create a new database and user by running the following commands on the MySQL shell:

CREATE USER vanilla_user@localhost IDENTIFIED BY 'strong-password';
GRANT ALL PRIVILEGES ON vanilla_db.* TO vanilla_user@localhost;

You can replace the database and username with your own and also make sure to replace strong-password with an actual strong password.

To exit the MySQL shell, type:


Step 5: Configure Apache

In this step, we will show you how to create a virtual host file for Apache – this is so you can access your Vanilla Forums using your domain name.

Create the virtual host file by executing the following command. We’ll be using ‘nano’ as our text editor, but you can use whatever you like:

sudo nano /etc/apache2/sites-available/mydomain.conf

And enter the following information:

<VirtualHost *:80>
     DocumentRoot /var/www/vanilla/

     <Directory /var/www/vanilla/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted

     ErrorLog /var/log/apache2/vanilla_error.log
     CustomLog /var/log/apache2/vanilla_access.log combined


Save and quit the file once the changes have been made.

In our example, we will use a domain called Make sure to replace with your actual domain/subdomain name that you would like to use for your Vanilla Forums.

Enable the “mydomain.conf” configuration in Apache using:

sudo a2ensite

Reload your Apache server in order to activate the new configuration:

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

Now just $43 .99

sudo systemctl reload apache2

Step 6: Installing Vanilla Forums

You can now navigate to in your browser to access the Vanilla Forums installation wizard.

You need to enter your database information which was created in Step 4 of this tutorial (username, database name, and password). NOTE: If you have Apache web server running on your VPS, you will also need to select the “Use Vanilla’s .htaccess.” option.

Enter the name of your application and admin email, username, and password, and then click on the Continue button.

The installation will be automatically completed and you will be taken to the Vanilla Forums dashboard.

That’s it! Vanilla Forums has been successfully installed on your Ubuntu 18.04 server.

Of course, you don’t have to know how to install Vanilla Forums on Ubuntu 18.04 if you have Managed Ubuntu Hosting with us. You can simply ask our support team to install Vanilla Forums on Ubuntu 18.04 for you. They are available 24/7, and will be able to help you with the installation of Vanilla Forums on Ubuntu 18.04.

PS. If you enjoyed reading this blog post on how to install Vanilla Forums on Ubuntu 18.04, feel free to share it on social networks by using the shortcuts below, or simply leave a comment in the comments section. Thank you.

10 thoughts on “How to Install Vanilla Forums on Ubuntu 18.04”

  1. Couldn’t save the virtual host file in the nano text editor. When I try to exit and save, it just says there is an error writing this file and that no such file or directory exists. Fell at the last hurdle.

      • I followed along using exactly what you shown but it never saves out.
        I swapped that last bit with the following:

        sudo nano /etc/apache2/sites-available/

        Populate the file.

        DocumentRoot /var/www/vanilla

        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all

        This saves out no problem.
        Not sure if I have used the right method as nothing seems to work for me.

        • The configuration file should be created at the following location:

          nano /etc/apache2/sites-available/mydomain.conf

          After this is done, you should enable it with:


          And reload your Apache web server:

          sudo systemctl reload apache2

      • The problem is that the directory /etc/httpd – and /etc/httpd/conf.d — do not exist.
        You cannot save a file in non-existent directories.

        Either the author of this article made a big mistake on where things are supposed to go – or forgot to create these directories.

  2. You mention “sudo yum install unzip” – this is ubuntu and yum doesnt exist.
    Unless I’m mistaken, you should fix that.

  3. I’ve followed everything listed here, but when I opened the webpage, it got stuck in Apache2 Ubuntu Default Page. Do you have any idea how to solve this?

    Thank you

    • Check your DocumentRoot if it is pointed to your vanilla forums directory and make sure to enable the virtual host you created using the a2ensite command.


Leave a Comment