LooonaDocslooona.com ↗

Self-host & build › Self-hosting › Install on your own server

Install on your own server

Run Looona on a Linux server, as a service, behind HTTPS. What it needs to work, then what's recommended.

Looona is one file. You download it, start it, and it keeps its data in its folder.

This guide sets it up on a Debian or Ubuntu server, for your team and the people who answer your forms. If you signed up on looona.com, there's nothing to install. To try Looona on your computer first, see On a Mac or Windows. All the files are in Download Looona.

The guide has two parts: what Looona needs to work, then what's recommended to keep it safe.

What you need

  • A Linux server you can reach with SSH, as a user who can run sudo.
  • A domain name pointing at that server, e.g. feedback.example.com. HTTPS needs it.

The guide edits files with nano, a simple editor in the terminal. In nano, you save with Ctrl+O then Enter, and you quit with Ctrl+X.

What it needs to work

Five steps: download Looona, run it as a service, put it behind HTTPS, tell Looona about it, then sign in.

Download Looona

  1. Make its folder

    Looona keeps its data in the folder it runs from.

    Terminal
    sudo mkdir -p /opt/looona
    
  2. Go into it

    Terminal
    cd /opt/looona
    
  3. Download Looona

    On an ARM server, write linux-arm64 in place of linux-x64. See Download Looona.

    Terminal
    sudo curl -L https://cdn.looona.fr/latest/looona-linux-x64.zip -o looona.zip
    
  4. Unzip it

    If unzip is missing, install it first with sudo apt install unzip.

    Terminal
    sudo unzip looona.zip
    
  5. Name it looona

    The file inside the zip is named after the system it's for.

    Terminal
    sudo mv looona-linux-x64 looona
    
  6. Delete the zip

    It's no longer needed.

    Terminal
    sudo rm looona.zip
    
  7. Let it run

    This marks the file as a program.

    Terminal
    sudo chmod +x looona
    

Run it as a service

A service starts Looona when the server boots, and again if it stops on an error.

  1. Give Looona its own user

    A user for Looona alone, which can't sign in to the server.

    Terminal
    sudo useradd -r -s /bin/false looona
    
  2. Give it the folder

    Looona only writes there.

    Terminal
    sudo chown -R looona:looona /opt/looona
    
  3. Create the service file

    nano opens an empty file.

    Terminal
    sudo nano /etc/systemd/system/looona.service
    
  4. Paste this

    It says who runs Looona, from which folder, and on which port (3030). It restarts Looona 5 seconds after an error. The last lines keep Looona to its folder.

    File
    [Unit]
    Description=Looona
    After=network.target
    
    [Service]
    User=looona
    Group=looona
    WorkingDirectory=/opt/looona
    ExecStart=/opt/looona/looona serve -p 3030
    Restart=on-failure
    RestartSec=5s
    NoNewPrivileges=true
    PrivateTmp=true
    ProtectSystem=strict
    ProtectHome=true
    ReadWritePaths=/opt/looona
    
    [Install]
    WantedBy=multi-user.target
    
  5. Save and close

    Press Ctrl+O, then Enter, then Ctrl+X.

  6. Load the new file

    The system reads its service files again.

    Terminal
    sudo systemctl daemon-reload
    
  7. Start Looona

    enable starts it at every boot, --now right away too.

    Terminal
    sudo systemctl enable --now looona
    
  8. Check it runs

    active (running) means it works. Press q to leave.

    Terminal
    sudo systemctl status looona
    

Put it behind HTTPS

Visitors reach Looona through a proxy: a program that handles HTTPS and passes each request on to Looona.

This guide uses Caddy as an example: it gets and renews the certificate on its own. Another proxy works too, like Nginx or Traefik. It must send requests to localhost:3030, keep the Host header, and set X-Forwarded-For. Its own documentation says how.

  1. Install Caddy

    Follow its guide for Debian and Ubuntu.

  2. Open its settings

    The file holds an example.

    Terminal
    sudo nano /etc/caddy/Caddyfile
    
  3. Delete the example

    Hold Ctrl+K until the file is empty.

  4. Paste this

    Write your domain in place of feedback.example.com.

    File
    feedback.example.com {
      reverse_proxy localhost:3030
    }
    
  5. Save and close

    Press Ctrl+O, then Enter, then Ctrl+X.

  6. Reload Caddy

    It reads its settings again, and gets the certificate.

    Terminal
    sudo systemctl reload caddy
    

Tell Looona about the proxy

Behind a proxy, every visitor seems to come from the proxy. Looona then counts the limits on responses for all of them together. This setting makes it count them per visitor.

  1. Open Looona's settings

    The file already holds its secret keys: leave their lines as they are.

    Terminal
    sudo nano /opt/looona/.env
    
  2. Add this line at the end

    File
    LOOONA_TRUST_PROXY=true
    
  3. Save and close

    Press Ctrl+O, then Enter, then Ctrl+X.

  4. Restart Looona

    It reads the file when it starts.

    Terminal
    sudo systemctl restart looona
    

Sign in

Open your domain, e.g. https://feedback.example.com. You see Create your account: you become the workspace's admin. See Getting started.

Then, in Settings, check the Looona address: shared links use it. See Workspace settings.

Looona works without these steps. They keep it safe, and your data too.

Close the other ports

Without a firewall, anyone can reach Looona directly on port 3030, without HTTPS. With LOOONA_TRUST_PROXY, they could also pretend to be any visitor, and get past the limits.

This example uses ufw, which comes with Ubuntu. On Debian, install it first with sudo apt install ufw. Your host's firewall works too: keep ports 22, 80 and 443 open, and nothing else.

  1. Keep SSH open

    Do this first, or you lose your access to the server.

    Terminal
    sudo ufw allow 22/tcp
    
  2. Open HTTP

    Caddy needs it to get the certificate, and to send visitors on to HTTPS.

    Terminal
    sudo ufw allow 80/tcp
    
  3. Open HTTPS

    Visitors come in there.

    Terminal
    sudo ufw allow 443/tcp
    
  4. Turn the firewall on

    Answer y. Every other port is closed now, 3030 too.

    Terminal
    sudo ufw enable
    

Back up every night

Looona makes a backup when an admin asks in Settings. To make one every night too:

  1. Open Looona's schedule

    The first time, the system asks for an editor: pick nano.

    Terminal
    sudo crontab -u looona -e
    
  2. Add this line at the end

    It makes a backup every day at 2 AM.

    File
    0 2 * * * cd /opt/looona && ./looona backup
    
  3. Save and close

    Press Ctrl+O, then Enter, then Ctrl+X.

The backups show in Settings, under Backups. They're kept on the same server: download one now and then. See Backups.

Update Looona

Back up, replace the file, and start Looona again. See Update Looona.

Where the data lives

Everything is in the folder Looona runs from, /opt/looona here:

  • database/database.sqlite: all the workspace's data, and logs.txt beside it.
  • backups/: the backups.
  • .env: the server's secret keys, made at the first start, and your server settings.

To move Looona to another server, stop it and copy the whole folder.

Commands

A few commands help when nobody can sign in. Run them in Looona's folder, as Looona's user, e.g. cd /opt/looona && sudo -u looona ./looona create-user.

  • looona reset-password <email> --temporary prints a password that works once, for 30 minutes. After signing in with it, you choose a new one.
  • looona create-user adds an account, with a few questions.
  • looona update-user-password sets a new password, with a few questions.

On a Mac or Windows, see Commands.

If something goes wrong

See what Looona says:

Terminal
sudo journalctl -u looona -n 50 --no-pager
  • It doesn't start. Another program may use port 3030. Pick another one with -p in the service file, and in the Caddyfile.
  • Permission denied. The looona user must own the folder: sudo chown -R looona:looona /opt/looona.
  • The page doesn't open. Check that both run: sudo systemctl status looona caddy. Then check that your domain points at the server.
  • Nobody can sign in. See Commands.

Warnings and errors also show in Looona, for admins. See Server logs.