git clone https://github.com/chad/freeq.git
cd freeq
./deploy/setup.sh yourdomain.com [--nginx] [--iroh]Options:
--nginx— Set up nginx reverse proxy with TLS (runs certbot)--iroh— Enable iroh transport for S2S federation
The setup script:
- Creates a dedicated
freeqsystem user (no login, no home, no sudo) - Checks for missing apt packages and prompts to install
- Checks for Rust/Node.js and prompts to install if missing
- Builds the server and web app
- Obtains a TLS cert via certbot (if
--nginxand not already present) - Sets up ssl-cert group for non-root cert access
- Generates and installs a systemd service from template
- Creates
/etc/freeq/secretsfor environment variables - Creates
/var/lib/freeq/for database storage - Optionally sets up nginx reverse proxy (if
--nginx) - Opens firewall ports
- Starts (or restarts) the service
The script is idempotent — safe to run multiple times.
./deploy/deploy.shPulls latest code, rebuilds server and web app, restarts the service.
Add environment variables to /etc/freeq/secrets. The systemd service loads this file automatically.
sudo vim /etc/freeq/secretsThe file is owned by root:freeq with mode 640 (readable by the freeq user).
sudo systemctl status freeq-server # Check status
sudo systemctl restart freeq-server # Restart
sudo systemctl stop freeq-server # Stop
sudo journalctl -u freeq-server -f # Tail logs| File | Purpose |
|---|---|
setup.sh |
Initial setup (installs deps, builds, configures services) |
deploy.sh |
Subsequent deploys (pull, build, restart) |
freeq-server.service.template |
Systemd unit template (setup.sh substitutes variables) |
nginx.conf.template |
Nginx config template (setup.sh substitutes variables) |
freeq-server.service |
Chad's example systemd unit (reference only) |
nginx-irc-freeq-at.conf |
Chad's production nginx config (reference only) |
irc/ |
Miren deployment (see below) |
Miren is a self-hosted PaaS. The irc/ subdirectory contains a complete deployment for Miren:
cd deploy/irc
./deploy.shThis script:
- Copies the workspace to a temp directory
- Generates a Miren app config and Procfile
- Runs
miren deploy -f - Sets the route (e.g.
irc.freeq.at)
The Procfile runs freeq-server with data stored at /app/data/. Miren sets $PORT for the web interface.
Requirements: Miren CLI installed and configured, route DNS pointing to your Miren instance.
| Path | Purpose |
|---|---|
/var/lib/freeq/freeq.db |
SQLite database |
/etc/freeq/secrets |
Environment variables (secrets) |
/etc/systemd/system/freeq-server.service |
Systemd unit |
If you prefer to set things up manually, the templates use these placeholders:
{{DOMAIN}}— your domain (e.g. freeq.example.com){{USER}}— system user running the service (default:freeq){{REPO_DIR}}— path to the freeq repo
Example:
sed -e 's|{{DOMAIN}}|freeq.example.com|g' \
-e 's|{{USER}}|freeq|g' \
-e 's|{{REPO_DIR}}|/home/ubuntu/freeq|g' \
deploy/freeq-server.service.template > /tmp/freeq-server.service
# Optional: add --iroh flag
sed -i 's|--server-name freeq.example.com \\|--server-name freeq.example.com \\\n --iroh \\|' /tmp/freeq-server.service