Demo mode: changes are disabled.

Skip to content

Other Ways to Install

Last updated

Install Deskply with your own certificate, a managed database, another system or web server, or by hand.

With your own certificate

For a certificate you bought, or one of Cloudflare's origin certificates. It must cover all your domains. Certbot is then not needed.

Terminal
sudo bash server/setup.sh \
  --certificate /etc/ssl/site/fullchain.pem \
  --key /etc/ssl/site/privkey.pem

With a managed database

In the panel of your provider, create a database and a user, and enable the vector extension (0.7.0 or newer). Before the setup, write the settings file; the setup keeps them.

Terminal
cd /var/www/saas
sudo cp backend/.env.example backend/.env
sudo nano backend/.env
backend/.env
DB_HOST=db.example.net
DB_PORT=5432
DB_DATABASE=saas
DB_USERNAME=saas
DB_PASSWORD=your-password

Without questions

Every answer except the password can be given beforehand:

Terminal
sudo SETUP_WEB_DOMAIN=app.example.com SETUP_API_DOMAIN=api.example.com \
  SETUP_PHONE=yes SETUP_VOICE_DOMAIN=voice.example.com \
  SETUP_ADMIN_NAME="Your Name" [email protected] \
  bash server/setup.sh

By hand

On another Linux system, or when you want to place every file yourself. You need the software of Before You Install, and experience with a Linux server. The files to copy are in server/templates/; replace each @NAME@ in them with your value.

  1. Files

    Put backend/ and frontend/ in a folder that nginx may read, owned by the user that runs the applications. Run every command below as that user, never as root.

  2. Database

    Terminal
    sudo -u postgres psql -c "CREATE USER saas WITH PASSWORD 'your-password';"
    sudo -u postgres psql -c "CREATE DATABASE saas OWNER saas;"
    sudo -u postgres psql -d saas -c "CREATE EXTENSION IF NOT EXISTS vector;"
  3. API

    In backend/, copy .env.example to .env and set APP_URL, FRONTEND_URL, DB_PASSWORD, VOICE_BRIDGE_PUBLIC_WSS_URL (empty without the phone agent) and REVERB_HOST=127.0.0.1. The installer asks for the admin and the purchase code, creates the tables and fills in the secrets.

    Terminal
    php artisan app:install
    php artisan optimize
  4. PHP-FPM

    Use php-fpm-pool.conf: PHP-FPM must run as the owner of the files, and accept uploads of 10 MB.

  5. Web app

    In frontend/, copy env.example to .env.local and set these. They are written into the build, so build again after a change.

    frontend/.env.local
    # Your own random value: openssl rand -base64 32
    NEXTAUTH_SECRET=
    NEXTAUTH_URL=https://app.example.com
    NEXT_PUBLIC_SITE_URL=https://app.example.com
    NEXT_PUBLIC_API_BASE_URL=https://api.example.com
    # REVERB_APP_KEY in backend/.env
    NEXT_PUBLIC_PUSHER_KEY=
    NEXT_PUBLIC_PUSHER_HOST=api.example.com
    NEXT_PUBLIC_PUSHER_PORT=443
    NEXT_PUBLIC_PUSHER_SCHEME=https
    Terminal
    npx pnpm@12 install --frozen-lockfile
    npx pnpm@12 build
  6. Services

    Copy the .service files to /etc/systemd/system/ and enable them, with two workers: saas-queue@1 and saas-queue@2. With another process manager, run the same ExecStart commands, give the queue worker 630 seconds to stop, and let cron run php artisan schedule:run every minute.

  7. nginx and HTTPS

    Copy the nginx-*.conf files to /etc/nginx/conf.d/. Write listen 80; in place of @LISTEN@ and remove the @REDIRECT_…@ lines: Certbot adds HTTPS.

    Terminal
    sudo nginx -t && sudo systemctl reload nginx
    sudo certbot --nginx -d app.example.com -d api.example.com -d voice.example.com

With Apache

Apache 2.4.47 or newer can replace nginx in an installation by hand. Switch on the modules, add the three sites, and get the certificate.

Terminal
sudo a2enmod rewrite proxy proxy_fcgi proxy_http proxy_wstunnel setenvif
sudo a2enconf php8.5-fpm
/etc/apache2/sites-available/saas.conf
<VirtualHost *:80>
    ServerName api.example.com
    DocumentRoot /var/www/saas/backend/public
    LimitRequestBody 104857600
    <Directory /var/www/saas/backend/public>
        AllowOverride All
        Require all granted
    </Directory>
    ProxyPass /app/ http://127.0.0.1:8081/app/ upgrade=websocket timeout=86400
</VirtualHost>

<VirtualHost *:80>
    ServerName app.example.com
    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:3000/
    ProxyPassReverse / http://127.0.0.1:3000/
</VirtualHost>

<VirtualHost *:80>
    ServerName voice.example.com
    ProxyPass / http://127.0.0.1:9500/ upgrade=websocket timeout=3600
</VirtualHost>
Terminal
sudo a2ensite saas
sudo apachectl configtest && sudo systemctl reload apache2
sudo certbot --apache -d app.example.com -d api.example.com -d voice.example.com

The browser installer

In place of php artisan app:install, an installation by hand can finish in the browser. With the API site already served and a .env in place, print a token and open https://api.example.com/install. It checks the requirements, asks for the database, the purchase code and the admin, and ends with the lines for the web app.

Terminal
php artisan app:install-token

Live updates

The panels get new messages, tickets and notifications through a websocket to Laravel Reverb, which is part of the API. No account is needed. The API reaches it inside the server (REVERB_HOST, REVERB_PORT, REVERB_SCHEME), browsers through the API's domain on port 443 (the NEXT_PUBLIC_PUSHER_* values). The setup does all of this; by hand, the key in both files must be the same. REVERB_APP_SECRET never goes into the web app.

To change the source

Start with Try It on Your Computer: it makes the settings files and the database. Stop it, then run the parts you work on in development mode, where a change shows at once. The addresses and ports are in the two settings files.

One terminal each
# In backend/
php artisan serve --host=127.0.0.1 --port=8000
php artisan queue:work --queue=default,knowledge,reminders,voice
php artisan reverb:start --host=127.0.0.1 --port=8081
php artisan voice:bridge

# In frontend/
npx pnpm@12 dev

To run the tests of the API, install its development packages first with composer install. Meta, Stripe, Twilio and Google only call public HTTPS addresses: use a tunnel.