install-on-a-server
title: Install on a server description: A server of yours, with systemd, PostgreSQL and Valkey, reached through Cloudflare Tunnel with no port open.
This is how uhlaka.org itself is installed: a small Linux server, the site listening only on the server itself, and the world reaching it through Cloudflare Tunnel.
What you need
- A Linux server with systemd (Ubuntu or Debian), 2 GB of memory or more, and SSH as root.
- A domain, with its DNS at Cloudflare if you use the tunnel.
Install
As root on the server:
curl -fsSL https://github.com/uhlaka-devs/uhlaka/releases/latest/download/install.sh \
| sh -s -- --host=server --database=postgres --public=https://example.com The installer:
- downloads the program for your platform and checks its checksum;
- installs PostgreSQL (or MySQL, MariaDB or SQLite, with
--database=) and makes the site's database; - installs Valkey, which keeps built pages, sessions and counters for every process (
--no-valkeyto do without); - makes a user
uhlaka, the folders/var/lib/uhlakaand/etc/uhlaka, and the servicesuhlakaanduhlaka-extensions; - starts the site on
127.0.0.1:4321(--port=to change it) and prints the link for the first page.
Without --yes, it asks for what you did not give it. A database of your own is given by its address (--database=postgres://…), and the installer tests it first.
The first page
The link the installer prints opens a page where you name the site, choose its language and make the owner's account. It is valid for one hour. If it expired, make another:
cd /var/lib/uhlaka && runuser -u uhlaka -- uhlaka setup-link "$(sed -n 's/^UHLAKA_SITE=//p' /etc/uhlaka/env)" --public=https://example.com Reaching it: Cloudflare Tunnel
The site listens only on the server, so nothing has to be open but SSH. In the Cloudflare dashboard, under Zero Trust, Networks, Tunnels, create a tunnel, install cloudflared on the server with the command it shows, and add a public hostname for your domain (and www) to the service http://127.0.0.1:4321. The tunnel passes the visitor's address and https on to the site.
Then, in the firewall of your provider, allow only SSH. A web server of your own (Caddy, nginx) in front of 127.0.0.1:4321 works as well.
Every day
| The service | systemctl status uhlaka, its log with journalctl -u uhlaka |
| Its settings | /etc/uhlaka/env |
| Update | uhlaka update, then systemctl restart uhlaka; the old program is kept as uhlaka.previous |
| A backup now | uhlaka backup <site> [folder], or in the admin under Backups, by day or week, sent to S3 if you want |
| Put one back | uhlaka restore <site> <file>, which first backs up what is there |
| An owner locked out | uhlaka reset-link <site> <email> --public=https://example.com |
<site> is the database address in UHLAKA_SITE in /etc/uhlaka/env. Run backup, restore and reset-link as the uhlaka user, as in the first-page command above; uhlaka update as root.