Guide · DigitalOcean

Install a self-hosted app on a DigitalOcean server

Put Lantern, Brightpail or any of the shop’s apps on your own $6-a-month DigitalOcean server, with your own address and HTTPS. Step by step, with every command to copy.

Time:
About 30 minutes
Steps:
16
Last checked:

Some links in this guide are affiliate links: if you sign up through them I may earn a commission, at no extra cost to you. I only recommend services I’ve tested.

This guide puts one of the shop's self-hosted apps, such as Lantern or Brightpail, on your own server at DigitalOcean, with your own web address and HTTPS. They're all built with Laravel and set up the same way; where an app needs something extra, the guide says so. The examples and screenshots use Lantern, and every command is one I ran on a real server.

You'll need:

  • A DigitalOcean account. The server in this guide costs $6 a month.
  • A domain name, such as yourname.com. You can use it directly or for an address like cv.yourname.com.
  • Your app's .zip file from your account on this site.
  • A terminal: Terminal on a Mac, or PowerShell on Windows 10 and 11. Both have ssh built in.

Throughout the guide, replace cv.example.com with your address, YOUR_SERVER_IP with your server's IP address (you'll get it in step 4), and lantern-1.0.0.zip with your download's name.

  1. Add your SSH key to DigitalOcean

    An SSH key lets you sign in to your server securely, without a password. Show your computer's public key with the command below and copy everything it prints.

    If it says "No such file", make a key first with ssh-keygen -t ed25519 (press Enter at each question), then run the command again.

    In DigitalOcean, go to Settings → Security → Add SSH Key, paste the key, give it a name like "My laptop" and click Add SSH Key.

    cat ~/.ssh/id_ed25519.pub
    DigitalOcean's New SSH key form with a public key pasted in and the name MacBook (current).
  2. Choose where your server runs, and Ubuntu

    Click Create → Droplets. Pick the region closest to most of your visitors, then under Choose an image keep Ubuntu 24.04 (LTS).

    The Create Droplet page with the San Francisco SFO3 region and Ubuntu 24.04 LTS selected.
  3. Pick the $6 plan (not the one already selected)

    DigitalOcean preselects a more expensive plan. Under Choose a Droplet Plan, keep Basic, change CPU Options to Regular, then choose $6/mo (1 GB memory, 25 GB disk). That's plenty for one of these apps.

    The $4 plan works too, but its 512 MB of memory is tight when the server installs updates.

    Choose a Droplet Plan with Basic, Regular CPU and the $6 a month plan selected.
    Basic → Regular → $6/mo.
  4. Choose your SSH key and create the server

    Under Authentication, keep SSH Keys and tick the key you added in step 1. Give the droplet a name (anything you like), check the total says $6.00/month, and click Create Droplet.

    After about a minute it shows as active, with its IP address (four numbers with dots). Copy it: that's YOUR_SERVER_IP from now on.

    The Authentication section with SSH Keys chosen and one key ticked.
  5. Point your address at the server

    Your address needs a DNS A record pointing at YOUR_SERVER_IP.

    • If your domain uses DigitalOcean's DNS: go to Networking → Domains, open your domain, click Create a record, choose type A, enter the hostname (for example cv, or @ for the domain itself), choose your droplet under Will direct to and click Create Record.
    • If your domain is with another company (GoDaddy, Namecheap…): add the same A record in their DNS settings.

    New records usually work within minutes. Wait until the address works before step 11.

    DigitalOcean's Create a record form: type A, hostname guide-test, directing to the guide-test-lantern droplet.
  6. Connect to your server

    In your terminal, connect as the root user. The first time, type yes when it asks whether to trust the server. Every command from here to step 12 runs on the server.

    ssh root@YOUR_SERVER_IP
  7. Install the web server and PHP

    This updates the server, then installs nginx (the web server) and PHP 8.3 with the extensions these apps use. It takes a minute or two.

    Brightpail: also install php8.3-imagick, so it can read iPhone photos. If your app's installer later lists anything else as missing, install it the same way.

    apt update && apt upgrade -y
    apt install -y nginx php8.3-fpm php8.3-sqlite3 php8.3-mysql php8.3-mbstring php8.3-xml php8.3-curl php8.3-zip php8.3-gd php8.3-intl php8.3-bcmath unzip
  8. Turn on the firewall, and allow bigger uploads

    The firewall lets in only SSH and web traffic. The second line lets you upload pictures and updates of up to 64 MB (PHP's standard limit is 2 MB).

    ufw allow OpenSSH && ufw allow 'Nginx Full' && ufw --force enable
    printf 'upload_max_filesize = 64M\npost_max_size = 64M\n' > /etc/php/8.3/fpm/conf.d/99-uploads.ini && systemctl reload php8.3-fpm
  9. Upload your app

    On your own computer (open a second terminal window), in the folder with your download, send the zip to the server:

    scp lantern-1.0.0.zip root@YOUR_SERVER_IP:/tmp/

    Back on the server, unpack it into /var/www/app and give the web server ownership. The zip unpacks to a folder named like the file (lantern-1.0.0).

    Brightpail: its zip holds the documentation beside the app, so move the app's own folder instead: mv brightpail-1.1.1/source app in place of the mv below.

    cd /var/www && unzip -q /tmp/lantern-1.0.0.zip && mv lantern-1.0.0 app
    chown -R www-data:www-data /var/www/app && rm /tmp/lantern-1.0.0.zip
  10. Tell nginx about your site

    Paste this whole block. First change cv.example.com to your address on the server_name line. It sends visitors to the app's public folder and never serves hidden files such as .env.

    cat > /etc/nginx/sites-available/app <<'EOF'
    server {
        listen 80;
        listen [::]:80;
        server_name cv.example.com;
        root /var/www/app/public;
        index index.php;
        client_max_body_size 64M;
    
        location / {
            try_files $uri $uri/ /index.php?$query_string;
        }
    
        location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php8.3-fpm.sock;
        }
    
        location ~ /\.(?!well-known) {
            deny all;
        }
    }
    EOF
    ln -s /etc/nginx/sites-available/app /etc/nginx/sites-enabled/app
    rm /etc/nginx/sites-enabled/default
    nginx -t && systemctl reload nginx
  11. Turn on HTTPS

    Let's Encrypt gives you a free certificate, and certbot installs it and renews it automatically. Change cv.example.com to your address. This agrees to Let's Encrypt's terms.

    If it fails with "NXDOMAIN" or "no valid A records", your address isn't pointing at the server yet: wait a few minutes after step 5 and try again.

    apt install -y certbot python3-certbot-nginx
    certbot --nginx -d cv.example.com --agree-tos --register-unsafely-without-email --redirect
  12. Scheduled tasks (only if your app needs them)

    Some apps do work in the background every day, such as Brightpail's repeat bookings, emails and clean-ups. Their documentation asks for a "cron job". This adds it, running as the web server's user. Lantern doesn't need it: skip this step.

    (crontab -u www-data -l 2>/dev/null; echo '* * * * * cd /var/www/app && php artisan schedule:run >> /dev/null 2>&1') | crontab -u www-data -
  13. Run your app's installer

    Open https://cv.example.com in your browser. The installer checks the server first. Lantern's is shown here; the others look much the same. You should see that your server has everything the app needs.

    Lantern's installer: the server check says the server has everything Lantern needs, with Simple (SQLite) chosen as the database.
  14. Fill in your details

    Choose the simple SQLite database if it's offered: there's nothing to set up. Enter your site's name, then your name, email and a strong password for the admin, and finish the installer.

    Lantern's installer form with the site name, admin name and email filled in.
  15. You're in

    A few seconds later you're in your admin area, where a Getting started list walks you through the rest of your app's setup.

    Lantern's admin dashboard saying Lantern is installed, with the Getting started checklist.
  16. Add your license key for one-click updates

    Open Updates in the admin (in Brightpail it's under Settings → Updates) and enter the license key from your purchase email. From then on, Check for updates shows new versions, and Update now installs them, with a backup first and an automatic undo if anything goes wrong.

    Lantern's Updates page: version 1.0.0, a license key box, and Install from a file with a 64 MB upload limit.

What next

  • Set up your app: follow its Getting started list and its documentation (included in your download).
  • Back up: use your app's own backup in its admin, and consider DigitalOcean's weekly backups for a small monthly charge.
  • Keep the server up to date: Ubuntu installs security updates by itself. Once a month, also run apt update && apt upgrade -y.

If something goes wrong

  • "502 Bad Gateway": PHP isn't running. Run systemctl restart php8.3-fpm.
  • The site doesn't load at all: check the address points at your server (step 5) and that nginx -t says the configuration is OK.
  • Anything else: the details are in /var/www/app/storage/logs/laravel.log. Send them to support and I'll help.

Looking for an app to install? See the shop.