Server Administration
Run Grengin on your own server day to day: updates, logs, backups and, on AWS, domain and TLS. On your workspace, all of this is handled for you.
AWS & self-hosted only
- Install script The
grengincommand (below) - AWS image systemd, Nginx and the scripts in
/opt/grengin/scripts/ - In the browser Control Hub → System Metrics → Maintenance for domain, TLS and updates (AWS image)
Install script
If you installed with the install script, everything runs as your user from ~/.grengin:
| Task | Command |
|---|---|
| Check it’s running | grengin status |
| Start, stop, restart | grengin start, grengin stop, grengin restart |
| Update to the latest release | grengin update, then grengin restart |
| Change the database or callback address | grengin configure, then grengin restart |
| Logs | ~/.grengin/logs/api.log and web.log |
| Back up | pg_dump your database, and copy ~/.grengin/config.env |
| Remove it | grengin uninstall (your database is kept) |
Tip Back up the database before
grengin update. Keepconfig.envwith every backup: without itsAPP_KEY, a restore can’t read stored credentials.
The rest of this page is for the AWS image.
Common tasks
| Task | Command |
|---|---|
| Update Grengin | sudo /opt/grengin/scripts/update-app-binaries.sh --version vX.Y.Z |
| Change domain and TLS | sudo /opt/grengin/scripts/reconfigure-domain.sh --domain chat.example.com --ssl-mode letsencrypt --email admin@example.com |
| Back up the database | sudo -u postgres pg_dump grengin > grengin-$(date +%F).sql |
| Restore the database | sudo -u postgres psql grengin < grengin-2026-01-01.sql |
| API logs, live | sudo journalctl -u grengin -f |
| Health check | curl -i http://localhost/api |
Restart after editing .env | sudo systemctl restart grengin |
| Reload Nginx | sudo nginx -t && sudo systemctl reload nginx |
SSH access
On AWS, use your launch key pair, as ubuntu (Ubuntu image) or ec2-user (AlmaLinux image):
ssh -i my-key.pem ubuntu@<public-ip>
Root and password login are disabled on the AWS image; use sudo.
Services and files
| Service | What it runs |
|---|---|
grengin | The API, as the grengin user |
nginx | Web app, and /api proxy to port 8080 |
postgresql | Local database, if the wizard installed it |
grengin-installer | Setup wizard (AWS image only) |
Config is /etc/grengin/.env, scripts are in /opt/grengin/scripts/. All file locations →
Logs
sudo journalctl -u grengin -f # API, live
sudo journalctl -u grengin --since today # API, today
sudo journalctl -u grengin-installer # setup wizard (AWS image)
sudo tail -f /var/log/nginx/error.log # Nginx
Health check
curl -i http://localhost/api returns:
| Response | Meaning |
|---|---|
200 | Ready. JSON body includes status and version. |
503 | Degraded, e.g. the database is unreachable. |
To hit the API directly on the server, use http://127.0.0.1:8080/. From elsewhere, use https://<your-domain>/api.
Update Grengin
-
Back up Database and
/etc/grengin/.env. How → -
Run the update script A release tag such as
v0.9.6, orlatest.sudo /opt/grengin/scripts/update-app-binaries.sh --version vX.Y.Z -
Let it restart It pulls the API from
ghcr.io/grengin-oss/grengin-api, checks it runs here, installs it and restartsgrengin. Migrations run on start.
| Option | Effect |
|---|---|
--version <latest|vX.Y.Z> | Release. Default latest. |
--skip-api, --skip-installer | Leave a component as is |
--skip-checksum | Skip checksums (not recommended) |
--arch <x86_64|aarch64> | Override detected architecture |
All options: update-app-binaries.sh --help.
Change the domain and TLS
-
Prepare DNS (Let’s Encrypt only) A record to the server, port 80 open.
-
Run the script
sudo /opt/grengin/scripts/reconfigure-domain.sh \ --domain chat.example.com --ssl-mode letsencrypt --email admin@example.com -
Update your OAuth app Callbacks in Google or Entra:
https://<new-domain>/auth/google/callbackor/auth/azure/callback.
--ssl-mode | What it does |
|---|---|
letsencrypt | Certbot certificate. Needs --email. |
selfsigned | Self-signed certificate; --self-signed-days (default 825) |
none | Plain HTTP (not recommended) |
It backs up the Nginx site and .env, updates REDIRECT_URL, and restarts the API about 30 seconds later, rolling back if the restart fails.
Backup and restore
Back up the database, config file and uploaded files. On AWS, an EBS volume snapshot captures all three.
Warning Keep
/etc/grengin/.envwith every database backup. Without itsAPP_KEY, a restore can’t read stored credentials.
Back up:
sudo -u postgres pg_dump grengin > grengin-$(date +%F).sql
sudo cp /etc/grengin/.env grengin-env-$(date +%F)
sudo tar czf grengin-files-$(date +%F).tar.gz /var/lib/grengin/files
Restore into an empty grengin database:
sudo systemctl stop grengin
sudo -u postgres psql grengin < grengin-2026-01-01.sql
sudo cp grengin-env-2026-01-01 /etc/grengin/.env
sudo tar xzf grengin-files-2026-01-01.tar.gz -C /
sudo systemctl start grengin
Uploads are in /var/lib/grengin/files (File storage →).
Security notes
| Practice | Detail |
|---|---|
| Finish the wizard promptly | Until then, port 80 serves a login-free installer. Restrict 22 and 80 to your IP. |
| Use HTTPS | In the Domain step, or later with reconfigure-domain.sh |
| Don’t expose port 8080 | Only Nginx should reach the API |
Protect /etc/grengin/.env | Holds the database password and secrets. Keep it root and grengin group only, and backups private. |
| Secrets are unique per instance | Generated on your server; provider keys encrypted at rest |
| AWS image is hardened | IMDSv2, no root or password SSH, firewall allows only SSH, HTTP, HTTPS |
| Browser maintenance runs as root | /etc/sudoers.d/grengin-reconfigure lets grengin run both maintenance scripts for Control Hub → Maintenance. Delete it to turn this off. |
Related
- System Maintenance Domain, TLS and updates from the browser.
- Configuration Reference Every variable in
.env. - Docker Published images and a local test run.