Log inSign up

Hosting a Vanilla community forum

Download the open source Vanilla release from the project GitHub page, unpack it into /var/www/vanilla, make conf, cache and uploads writable for PHP, and serve it through Nginx with the rewrite to index.php that Vanilla expects. Complete the browser setup at /dashboard/setup, switch on clean URLs and add HTTPS.

Topic: Websites, CMS and shops · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

What should you know before installing Vanilla?

Vanilla is a PHP discussion forum with categories, reactions, badges through addons and a moderation dashboard. The open source edition is distributed as release archives on the project GitHub page, while the hosted edition is a separate product; this guide covers the self-hosted code only.

Each release states which PHP and MySQL or MariaDB versions it supports in its README and release notes. Read them for the release you pick before choosing the operating system: if the release targets an older PHP than your distribution ships, either pick a matching image (for example Ubuntu 22.04) or follow running older PHP versions. A forum with a few hundred active members runs comfortably on 1 to 2 GB of RAM. As usual you need a sudo user and DNS records for forum.example.net (DNS records).

How do you install the web stack?

Install Nginx, MariaDB and PHP-FPM with the extensions Vanilla uses for database access, images, text handling and outgoing requests.

sudo apt update
sudo apt install -y nginx mariadb-server php-fpm php-mysql php-gd php-mbstring php-curl php-xml php-intl php-zip unzip
php -v
ls /run/php/

Note the PHP version and socket name from the last two commands; the Nginx configuration below needs them. If you require a different PHP release than the default, install it side by side and point Nginx at its FPM socket. The general layout of such a stack is explained in the LEMP stack guide.

How do you create the forum database?

sudo mariadb-secure-installation
sudo mariadb -e "CREATE DATABASE vanilla CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
sudo mariadb -e "CREATE USER 'vanilla'@'localhost' IDENTIFIED BY 'vanilla-db-secret';"
sudo mariadb -e "GRANT ALL ON vanilla.* TO 'vanilla'@'localhost';"
sudo mariadb -e "SHOW DATABASES;"

The utf8mb4 character set stores emoji and every script your members write. Choose a long random password with openssl rand -base64 24; the setup wizard asks for it once and writes it to conf/config.php.

How do you download and unpack Vanilla?

Grab the archive of the latest open source release, unpack it and set ownership so PHP can write the three runtime folders.

VANILLA_URL="paste-the-release-zip-link-here"
cd /tmp
curl -L -o vanilla.zip "$VANILLA_URL"
unzip -q vanilla.zip -d vanilla-src
ls vanilla-src
sudo mkdir -p /var/www/vanilla
sudo cp -a vanilla-src/*/. /var/www/vanilla/
cd /var/www/vanilla
sudo chown -R root:root .
sudo chown -R www-data:www-data conf cache uploads
sudo chmod -R 775 conf cache uploads

Look at the ls output first: if the archive unpacks without a top level folder, copy vanilla-src/. instead. Leaving the code owned by root and only the runtime folders writable means a compromised plugin cannot rewrite the application itself. Make sure the release archive contains the vendor folder; if you cloned source code instead, you must run Composer and build the front end, which is far more work.

How do you configure Nginx for Vanilla?

Vanilla routes almost everything through index.php and needs the X_REWRITE parameter so it knows rewriting is active.

server {
    listen 80;
    listen [::]:80;
    server_name forum.example.net;
    root /var/www/vanilla;
    index index.php;
    client_max_body_size 16m;

    location ~* /\.git { deny all; return 403; }
    location ~ ^/(build|cache|conf|tests|vendor|uploads/import)/ { deny all; return 403; }

    location ~* ^/index\.php(/|$) {
        include fastcgi_params;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        fastcgi_param SCRIPT_NAME /index.php;
        fastcgi_param SCRIPT_FILENAME $realpath_root/index.php;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param X_REWRITE 1;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
    }
    location ~* \.php(/|$) { rewrite ^ /index.php$uri last; }
    location / { try_files $uri @vanilla; }
    location @vanilla { rewrite ^ /index.php$uri last; }
}

Save it as /etc/nginx/sites-available/vanilla, link it into sites-enabled, replace the socket with the one you noted, then check and reload:

sudo ln -s /etc/nginx/sites-available/vanilla /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

Every PHP request, even one for another script name, ends up in index.php, so stray scripts in addon folders cannot be called directly.

How do you secure the forum and run setup?

Add the certificate first so the setup wizard and the stored forum URL use HTTPS from the start. The Certbot steps are explained in the Certbot and Let's Encrypt guide.

sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable
sudo certbot --nginx -d forum.example.net --redirect

Now open https://forum.example.net/dashboard/setup. The wizard asks for the database host (localhost), name, user and password, then for the forum title and the first administrator account. When it finishes, check that clean URLs are on by opening conf/config.php and confirming the line $Configuration['Garden']['RewriteUrls'] = true;. Afterwards make conf/config.php read only for everyone except its owner with sudo chmod 640 conf/config.php, keeping the group as www-data.

How do you send notification emails?

Registration confirmations, password resets and new post notifications need mail. In the dashboard open Settings, Email and select SMTP, then enter the relay host, port 587, STARTTLS and the account credentials. An authenticated relay is the dependable choice, as explained in SMTP relay for apps; port 25 from the server should not be counted on, and a support ticket is the place to ask before planning direct delivery.

Send a test message from the same page. If it fails, the reason usually appears in /var/log/nginx/error.log or in the PHP-FPM journal (journalctl -u php8.3-fpm, adjusted to your version). Spam signups are the most common forum problem, so also enable email confirmation and an approval or captcha addon under Registration.

How do you back up and update Vanilla?

Your forum consists of the database, conf/config.php and the uploads folder; everything else comes from the release archive.

sudo mariadb-dump --single-transaction vanilla | gzip > ~/vanilla-$(date +%F).sql.gz
sudo tar -czf ~/vanilla-data-$(date +%F).tar.gz -C /var/www/vanilla conf uploads

Copy those archives off the server, for example with rsync. To update, unpack the new release next to the old one, copy conf/config.php, uploads and any third party addons and themes into it, switch the Nginx root or a symlink to the new folder and visit /utility/update as an administrator to run database migrations. Keep the previous folder until you have checked posting, login and email. When a page shows a bare error, set $Configuration['Debug'] = true; temporarily in conf/config.php to see details, then remove it again.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A1-2a new community forum1 vCPU, 2 GB RAM, 50 GB NVMe$7.20/mo$43.20 for 6 months
A2-4busier forums with more uploads2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months

Questions about Vanilla Forums open source

Is Vanilla Forums still open source?

The self-hosted code is published on the project GitHub page under an open source license. Check the latest release date and notes there before you commit to it.

Why does every page return 404 except the home page?

The rewrite to index.php$uri or the X_REWRITE parameter is missing from the Nginx config. Add both and reload.

The setup page says a folder is not writable. What now?

Give conf, cache and uploads to the PHP user with chown -R www-data:www-data and reload the page.

Can I import posts from another forum?

Vanilla has a porter tool that exports many forum databases into a file Vanilla can import from the dashboard.

How large should the server be?

Start with 1 to 2 GB of RAM. Busy communities with search and many uploads benefit from 4 GB and more disk.