Vanilla

How To Install Vanilla Forums on Ubuntu 24.04 or Newer

Welcome back to the Greenhost.cloud blog! Today, we’re diving into the world of online communities by showing you how to install Vanilla Forums on your Ubuntu 24.04 (or newer) server. Vanilla Forums is a powerful open-source forum software that allows you to create a vibrant online community. Whether you’re looking to establish a support forum, a discussion platform, or a niche community, Vanilla Forums is an excellent choice.

Let’s get started!

Prerequisites

Before we begin, ensure you have the following:

  1. A server running Ubuntu 24.04 or newer.
  2. Root or sudo access to your server.
  3. LAMP Stack (Linux, Apache, MySQL, PHP) installed on your server. If you don’t have this set up yet, follow these steps:
  • Install Apache:
    bash sudo apt update sudo apt install apache2
  • Install MySQL:
    bash sudo apt install mysql-server
    After installation, secure your MySQL installation:
    bash sudo mysql_secure_installation
  • Install PHP and necessary extensions:
    bash sudo apt install php php-mysql php-xml php-mbstring php-curl php-zip
  1. Composer installed on your server. If Composer isn’t installed, do so with the following commands:
   sudo apt install curl
   curl -sS https://getcomposer.org/installer | php
   sudo mv composer.phar /usr/local/bin/composer

Step 1: Download Vanilla Forums

First, navigate to the directory where you want to install Vanilla Forums:

cd /var/www/html

Next, download the latest version of Vanilla Forums from the official website or GitHub repository. As of the time of this writing, the command is:

composer create-project vanilla/vanilla

This will create a new directory called vanilla in your current path.

Step 2: Set Permissions

Change the ownership of the Vanilla Forums folder to the Apache user. This allows the web server to read and write files as necessary:

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

Next, set the correct permissions:

sudo find /var/www/html/vanilla -type d -exec chmod 755 {} \;
sudo find /var/www/html/vanilla -type f -exec chmod 644 {} \;

Step 3: Create a MySQL Database

You need to create a database and user for Vanilla Forums. Log in to your MySQL server:

sudo mysql -u root -p

Once logged in, run the following commands to create a database and user:

CREATE DATABASE vanilla_db;
CREATE USER 'vanilla_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON vanilla_db.* TO 'vanilla_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Make sure to replace your_password with a strong password of your choice.

Step 4: Configure Apache

You need to create a new Apache configuration file for your Vanilla Forums installation. Using your preferred text editor, create a new file:

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

Add the following configuration, adjusting the ServerName and DocumentRoot as needed:

<VirtualHost *:80>
    ServerName yourdomain.com
    DocumentRoot /var/www/html/vanilla

    <Directory /var/www/html/vanilla>
        AllowOverride All
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/vanilla_error.log
    CustomLog ${APACHE_LOG_DIR}/vanilla_access.log combined
</VirtualHost>

Enable the site and the mod_rewrite module:

sudo a2ensite vanilla.conf
sudo a2enmod rewrite

Finally, restart Apache to apply the changes:

sudo systemctl restart apache2

Step 5: Complete the Installation

Now, open your web browser and navigate to your server’s IP address or domain name:

http://yourdomain.com

Follow the on-screen instructions to complete the Vanilla Forums installation. You’ll be prompted to enter the database details you created earlier. Fill in the database name, user, and password, and proceed with the setup.

Step 6: Post-Installation Configuration

Once the installation is complete, you should consider additional configurations:

  1. Secure your installation by enabling HTTPS. You can use Let’s Encrypt for a free SSL certificate.
  2. Regular backups of your database and files to prevent data loss.
  3. Monitor performance and optimize your server as your community grows.

Conclusion

Congratulations! You have successfully installed Vanilla Forums on your Ubuntu 24.04 server. You’re now equipped to build and manage your own online community. At Greenhost.cloud, we’re dedicated to supporting you in your hosting journey. If you have any questions or need further assistance, feel free to reach out.