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.
sudo bash server/setup.sh \
--certificate /etc/ssl/site/fullchain.pem \
--key /etc/ssl/site/privkey.pemWith 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.
cd /var/www/saas
sudo cp backend/.env.example backend/.env
sudo nano backend/.envDB_HOST=db.example.net
DB_PORT=5432
DB_DATABASE=saas
DB_USERNAME=saas
DB_PASSWORD=your-passwordWithout questions
Every answer except the password can be given beforehand:
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.shBy 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.
Files
Put
backend/andfrontend/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.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;"API
In
backend/, copy.env.exampleto.envand setAPP_URL,FRONTEND_URL,DB_PASSWORD,VOICE_BRIDGE_PUBLIC_WSS_URL(empty without the phone agent) andREVERB_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 optimizePHP-FPM
Use
php-fpm-pool.conf: PHP-FPM must run as the owner of the files, and accept uploads of 10 MB.Web app
In
frontend/, copyenv.exampleto.env.localand 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=httpsTerminal npx pnpm@12 install --frozen-lockfile npx pnpm@12 buildServices
Copy the
.servicefiles to/etc/systemd/system/and enable them, with two workers:saas-queue@1andsaas-queue@2. With another process manager, run the sameExecStartcommands, give the queue worker 630 seconds to stop, and let cron runphp artisan schedule:runevery minute.nginx and HTTPS
Copy the
nginx-*.conffiles to/etc/nginx/conf.d/. Writelisten 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.
sudo a2enmod rewrite proxy proxy_fcgi proxy_http proxy_wstunnel setenvif
sudo a2enconf php8.5-fpm<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>sudo a2ensite saas
sudo apachectl configtest && sudo systemctl reload apache2
sudo certbot --apache -d app.example.com -d api.example.com -d voice.example.comThe 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.
php artisan app:install-tokenLive 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.
# 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 devTo 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.