On this pageInstall script

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.

3 min read v1

AWS & self-hosted only

  • Install script The grengin command (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:

TaskCommand
Check it’s runninggrengin status
Start, stop, restartgrengin start, grengin stop, grengin restart
Update to the latest releasegrengin update, then grengin restart
Change the database or callback addressgrengin configure, then grengin restart
Logs~/.grengin/logs/api.log and web.log
Back uppg_dump your database, and copy ~/.grengin/config.env
Remove itgrengin uninstall (your database is kept)

Tip Back up the database before grengin update. Keep config.env with every backup: without its APP_KEY, a restore can’t read stored credentials.

The rest of this page is for the AWS image.

Common tasks

TaskCommand
Update Grenginsudo /opt/grengin/scripts/update-app-binaries.sh --version vX.Y.Z
Change domain and TLSsudo /opt/grengin/scripts/reconfigure-domain.sh --domain chat.example.com --ssl-mode letsencrypt --email admin@example.com
Back up the databasesudo -u postgres pg_dump grengin > grengin-$(date +%F).sql
Restore the databasesudo -u postgres psql grengin < grengin-2026-01-01.sql
API logs, livesudo journalctl -u grengin -f
Health checkcurl -i http://localhost/api
Restart after editing .envsudo systemctl restart grengin
Reload Nginxsudo 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

ServiceWhat it runs
grenginThe API, as the grengin user
nginxWeb app, and /api proxy to port 8080
postgresqlLocal database, if the wizard installed it
grengin-installerSetup 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:

ResponseMeaning
200Ready. JSON body includes status and version.
503Degraded, 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

  1. Back up Database and /etc/grengin/.env. How →

  2. Run the update script A release tag such as v0.9.6, or latest.

    sudo /opt/grengin/scripts/update-app-binaries.sh --version vX.Y.Z
    
  3. Let it restart It pulls the API from ghcr.io/grengin-oss/grengin-api, checks it runs here, installs it and restarts grengin. Migrations run on start.

OptionEffect
--version <latest|vX.Y.Z>Release. Default latest.
--skip-api, --skip-installerLeave a component as is
--skip-checksumSkip checksums (not recommended)
--arch <x86_64|aarch64>Override detected architecture

All options: update-app-binaries.sh --help.

Change the domain and TLS

  1. Prepare DNS (Let’s Encrypt only) A record to the server, port 80 open.

  2. Run the script

    sudo /opt/grengin/scripts/reconfigure-domain.sh \
      --domain chat.example.com --ssl-mode letsencrypt --email admin@example.com
    
  3. Update your OAuth app Callbacks in Google or Entra: https://<new-domain>/auth/google/callback or /auth/azure/callback.

--ssl-modeWhat it does
letsencryptCertbot certificate. Needs --email.
selfsignedSelf-signed certificate; --self-signed-days (default 825)
nonePlain 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/.env with every database backup. Without its APP_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

PracticeDetail
Finish the wizard promptlyUntil then, port 80 serves a login-free installer. Restrict 22 and 80 to your IP.
Use HTTPSIn the Domain step, or later with reconfigure-domain.sh
Don’t expose port 8080Only Nginx should reach the API
Protect /etc/grengin/.envHolds the database password and secrets. Keep it root and grengin group only, and backups private.
Secrets are unique per instanceGenerated on your server; provider keys encrypted at rest
AWS image is hardenedIMDSv2, 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.
Was this page helpful?
GitHub (opens in a new tab)