Install on a server
This guide installs the backend and the admin panel on a fresh Ubuntu 24.04 VPS with Nginx, PHP 8.4 and MySQL 8.4. Other Linux distributions and Apache work the same way; only the package names and the web server config differ.
The examples use api.yourbrand.com as the domain and /var/www/niceserve as the folder. Replace both with your own.
Before you start, point your domain's DNS A record at the server's IP address.
1. Install the server software
sudo apt update
sudo apt install -y nginx mysql-server unzip git curl \
php8.4-fpm php8.4-cli php8.4-mysql php8.4-mbstring php8.4-intl php8.4-gd \
php8.4-zip php8.4-bcmath php8.4-curl php8.4-xml
If your Ubuntu doesn't have PHP 8.4 yet, add the ppa:ondrej/php repository first.
Install Composer:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
Node.js 24 is only needed to build the admin panel (step 4). You can also build it on your own computer and upload the result.
2. Create the database
sudo mysql
CREATE DATABASE niceserve CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'niceserve'@'localhost' IDENTIFIED BY 'choose-a-strong-password';
GRANT ALL PRIVILEGES ON niceserve.* TO 'niceserve'@'localhost';
FLUSH PRIVILEGES;
EXIT;
3. Upload the code and configure the backend
Upload the package to /var/www/niceserve, so that the backend is at /var/www/niceserve/backend. Then install the PHP packages, which the package doesn't include:
cd /var/www/niceserve/backend
composer install --no-dev --optimize-autoloader
cd /var/www/niceserve/backend
cp .env.example .env
php artisan key:generate
Edit .env:
APP_NAME="YourBrand"
APP_ENV=production
APP_DEBUG=false
APP_URL=https://api.yourbrand.com
DB_DATABASE=niceserve
DB_USERNAME=niceserve
DB_PASSWORD=choose-a-strong-password
# The admin panel is served from the same domain
SANCTUM_STATEFUL_DOMAINS=api.yourbrand.com
SESSION_SECURE_COOKIE=true
QUEUE_CONNECTION=database
Keep
APP_KEYsafe and never change it after you go live. Secrets you enter in the admin panel (Stripe keys, SMTP password…) are encrypted with it.
You can leave the MAIL_* lines as they are and enter your SMTP details in the admin panel later (Email and file storage).
Create the tables, the default settings and the first admin account:
php artisan migrate --seed --force
php artisan storage:link
php artisan optimize
The seed creates the admin admin@example.com with the password password. You'll replace it in First steps; don't leave it in place.
Give the web server write access to the folders Laravel writes to:
sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R ug+rwX storage bootstrap/cache
4. Build the admin panel
The download package already contains the built admin panel; skip this step. Only if you install from source, or changed the admin panel (admin-source/ in the package):
cd /var/www/niceserve/admin
npm ci
npm run build
The build writes into the backend: backend/public/admin-assets/ (scripts, styles) and backend/resources/admin/index.html. After this, node_modules can be deleted.
Building on your own computer instead? Run the same two commands there and upload those two folders.
5. Nginx and HTTPS
Create /etc/nginx/sites-available/niceserve:
server {
listen 80;
server_name api.yourbrand.com;
root /var/www/niceserve/backend/public;
index index.php;
client_max_body_size 20M; # photo and document uploads
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
}
location ~ /\.(?!well-known) {
deny all;
}
}
The .well-known exception matters: the deep-link verification files are served from /.well-known/ (Deep links).
sudo ln -s /etc/nginx/sites-available/niceserve /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d api.yourbrand.com
Check it: https://api.yourbrand.com/api/v1/health should answer, and https://api.yourbrand.com/admin shows the admin sign-in page.
6. Queue worker and scheduler
Queue worker. Emails, push notifications and image thumbnails are sent by a background worker. Keep it running with Supervisor:
sudo apt install -y supervisor
/etc/supervisor/conf.d/niceserve-worker.conf:
[program:niceserve-worker]
command=php /var/www/niceserve/backend/artisan queue:work --sleep=3 --tries=3 --max-time=3600
user=www-data
numprocs=1
autostart=true
autorestart=true
stopwaitsecs=3600
redirect_stderr=true
stdout_logfile=/var/www/niceserve/backend/storage/logs/worker.log
sudo supervisorctl reread && sudo supervisorctl update
Scheduler. Run sudo crontab -u www-data -e and add:
* * * * * cd /var/www/niceserve/backend && php artisan schedule:run >> /dev/null 2>&1
The scheduler runs these jobs:
| Job | Every | What it does |
|---|---|---|
bookings:process |
5 minutes | Expires unanswered requests, auto-confirms finished jobs, sends reminders 24 hours and 1 hour before a booking |
job-requests:expire |
15 minutes | Closes job posts that passed their dates |
payouts:release |
hour | Pays providers through Stripe Connect when it's on |
media:prune |
hour | Deletes uploads that were never attached to anything |
7. Live chat (optional)
Chat works out of the box: the app checks for new messages every few seconds. For instant updates, run Laravel Reverb next to the API. See Live chat with Reverb.
Shared hosting
On shared hosting (cPanel, Plesk), use the web installer instead: it needs no SSH and sets up the cron-driven queue for you.
Installing by hand on a host without Supervisor? Add QUEUE_VIA_SCHEDULER=true to .env: the single scheduler cron job then also sends queued emails and notifications every minute. Reverb usually isn't possible there; leave BROADCAST_CONNECTION=log and chat uses polling.
Next
Continue with First steps after installing.