Installing VulaSocial on a VPS / Dedicated Server
Operator guide
Installing VulaSocial on a VPS / Dedicated Server
A manual (non-Docker) install for a VPS or dedicated server where you control the full stack. Use this when you want nginx + PHP-FPM + MySQL directly on the host rather than containers.
Prerequisites
- Ubuntu 22.04/24.04 or Debian 12 (any modern distro works)
- PHP 8.5 with
pdo_mysql,mbstring,openssl,curl,zip,gd,intl,tokenizer,xml,dom,fileinfo,bcmath,iconv,sodium - MySQL 5.7+ / 8.x
- Composer 2.x
- nginx (or Apache)
1. Install PHP + extensions
sudo apt update
sudo apt install -y php8.5-cli php8.5-fpm php8.5-mysql php8.5-mbstring \
php8.5-gd php8.5-zip php8.5-intl php8.5-xml php8.5-bcmath php8.5-curl \
php8.5-sodium composer nginx mysql-server
If 8.5 isn't in your distro's repo yet, add the Sury PPA:
sudo add-apt-repository ppa:ondrej/php
2. Database
sudo mysql
CREATE DATABASE vulasocial CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'vulasocial'@'localhost' IDENTIFIED BY 'change-me-strong-password';
GRANT ALL PRIVILEGES ON vulasocial.* TO 'vulasocial'@'localhost';
FLUSH PRIVILEGES;
3. Deploy the code
sudo mkdir -p /var/www/vulasocial
sudo chown $USER:www-data /var/www/vulasocial
git clone https://github.com/charlesash-za/vulasocial.git /var/www/vulasocial
cd /var/www/vulasocial
composer install --no-dev --prefer-dist
cp .env.example .env
php artisan key:generate
4. Configure .env
APP_ENV=production
APP_DEBUG=false
APP_URL=https://your-node.example
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=vulasocial
DB_USERNAME=vulasocial
DB_PASSWORD=change-me-strong-password
QUEUE_CONNECTION=database
CACHE_STORE=database
SESSION_DRIVER=database
BROADCAST_CONNECTION=log
FEDERATION_PUBLIC_BASE_URL=https://your-node.example
Set SESSION_SECURE_COOKIE=true and SESSION_ENCRYPT=true.
5. Migrate + link storage
php artisan migrate --force
php artisan storage:link
php artisan optimize:clear
6. nginx vhost (document root → public)
Create /etc/nginx/sites-available/vulasocial:
server {
listen 80;
server_name your-node.example;
root /var/www/vulasocial/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.5-fpm.sock;
}
location ~ /\.(?!well-known) {
deny all;
}
}
sudo ln -s /etc/nginx/sites-available/vulasocial /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
Add HTTPS with certbot:
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d your-node.example
7. Storage permissions
sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R ug+rw storage bootstrap/cache
8. Workers & cron
Create /etc/systemd/system/vulasocial-queue.service:
[Unit]
Description=VulaSocial queue worker
After=network.target
[Service]
User=www-data
WorkingDirectory=/var/www/vulasocial
ExecStart=/usr/bin/php /var/www/vulasocial/artisan queue:work database --stop-when-empty --max-time=55
Restart=on-failure
[Install]
WantedBy=multi-user.target
sudo systemctl enable --now vulasocial-queue
And a cron for the scheduler + inbound consumer:
* * * * * cd /var/www/vulasocial && php artisan schedule:run >> /dev/null 2>&1
*/2 * * * * cd /var/www/vulasocial && php artisan fedifuel:consume-inbound >> /dev/null 2>&1
9. Admin user
See First-run setup.
Updating
cd /var/www/vulasocial
sudo -u www-data git pull
sudo -u www-data composer install --no-dev --prefer-dist
php artisan migrate --force
php artisan optimize:clear
See Updating an existing node for the full runbook.
Still stuck? Contact the node administrator.