Server installation
- Interactive install
- Unattended install
- Console over HTTP
- What gets installed
- Maintenance: repair, upgrade, backup, restore, password reset, uninstall
- After installing
install.sh installs DomainNotice on Ubuntu 24.04 LTS or newer (x64 or arm64). It uses no Docker and installs
no .NET runtime, because the server is published self-contained. Run it as root.
Interactive install
curl -fsSLO https://github.com/BarPos/DomainNotice/releases/latest/download/install.sh
sudo bash install.sh # downloads the latest release for this CPU
sudo bash install.sh --version 1.2.0 # a specific release
sudo bash install.sh --package DomainNotice.Server-1.2.0-linux-x64.tar.gz # offline, from a file
The script downloads from the releases of BarPos/DomainNotice (GITHUB_REPOSITORY at the top of the script) and
checks each download against the release’s SHA256SUMS.txt.
Unattended install
sudo DOMAINNOTICE_ADMIN_PASSWORD='…' ./install.sh --unattended --db=local \
--package DomainNotice.Server-1.0.0-linux-x64.tar.gz \
--server-name notice.example.local --console-port 443 \
--cert /etc/ssl/notice.pem --cert-key /etc/ssl/notice.key \
--admin-user admin --open-firewall=yes
| Option | Meaning |
|---|---|
--package FILE |
A DomainNotice.Server-<version>-linux-<arch>.tar.gz (checked against SHA256SUMS.txt next to it) |
--version X.Y.Z |
Download that release from GitHub (only once the repository is configured) |
--db=local |
PostgreSQL on this machine: installed when there is none, shared when there is one (see below). DomainNotice gets its own new role and database. --db-port picks the cluster when several run; --db-name / --db-user set the names (they must be free) |
--db=existing |
Use an existing PostgreSQL: --db-host, --db-port, --db-name, --db-user, --db-sslmode |
--server-name NAME |
DNS name used by browsers and agents (default: hostname -f) |
--console-port N |
Console port (default 443 for https, 80 for http) |
--cert, --cert-key |
An existing PEM certificate and key; without them a self-signed one is generated |
--console-mode=https\|http |
https (default): the Console serves HTTPS with a certificate. http: plain HTTP, no certificate. |
--admin-user NAME |
First local admin account |
--open-firewall=yes\|no |
Open the Console port and 5150 when ufw is active |
--secrets-file FILE / --secrets-stdin |
KEY=VALUE lines: ADMIN_PASSWORD, DB_PASSWORD (the file must be mode 600) |
Sharing PostgreSQL with other applications
With --db=local, a PostgreSQL that is already installed on the machine (from Ubuntu’s or the PostgreSQL project’s
packages) may keep serving other applications. Since 1.0.7 DomainNotice:
- only adds a new role and a new database. They are called
domainnotice, ordomainnotice_2,domainnotice_3, … when a role or database of that name already exists. An existing role or database is never altered or taken over. A name given with--db-name/--db-userthat is taken stops the install. - creates the role without superuser, database or role creation rights, and allows only that role (and superusers) to connect to its database.
- never installs, upgrades, reconfigures (
postgresql.conf,pg_hba.conf) or restarts PostgreSQL, and does not upgrade packages that are already installed. A cluster older than PostgreSQL 16 is refused, not upgraded. - uses the cluster on port 5432, or the only running one; with several, choose one with
--db-port. - connects with a password over
127.0.0.1. If the cluster’spg_hba.confdoes not allow that, the install stops, removes the role and database it just created, and shows the line to add. - when an install fails later on, removes the role and database that run created, and nothing else.
Backups, restores and update rollbacks work only inside DomainNotice’s own database (as its role): a backup dumps that
database, and a restore replaces the tables in it. --uninstall drops only that database and that role, after checking
that the database belongs to the role and the role is not a superuser. PostgreSQL itself, its packages and every other
database and role stay as they are.
Passwords are never accepted as command-line flags, because other users can read the process list. They come
from --secrets-file, --secrets-stdin, the environment (DOMAINNOTICE_ADMIN_PASSWORD, DOMAINNOTICE_DB_PASSWORD)
or a hidden prompt.
Using an existing PostgreSQL
- The server must run PostgreSQL 16 or newer.
- If it is newer than 16, the script adds the PostgreSQL apt repository and installs the matching
postgresql-client(needed forpg_dumpbackups). - The role must own the database, so that an update can restore a backup on rollback.
Console over HTTP
--console-mode=http makes the Console serve plain HTTP, with no certificate. Use it when HTTPS is handled elsewhere,
for example by a reverse proxy you run yourself, or on an isolated test network.
sudo ./install.sh --console-mode=http # interactive: asks for the HTTP port (default 80)
sudo DOMAINNOTICE_ADMIN_PASSWORD='…' ./install.sh --unattended --db=local --console-mode=http --console-port 80 \
--server-name notice.example.com --admin-user admin
The installer writes "Console": { "Urls": "http://0.0.0.0:80", "Certificate": "" } and creates no certificate. The
self-update health check uses http://127.0.0.1:<port>/healthz.
Over plain HTTP, sign-in passwords and session cookies travel unencrypted. Use it only behind an HTTPS front end or on a trusted network.
The agent link is not affected. Agents always use TLS over raw TCP on port 5150, with key pinning, and connect to the DomainNotice server directly. If you put a reverse proxy in front of the Console, do not route port 5150 through it.
If you put a reverse proxy in front of the Console:
- it must allow WebSocket upgrades, because the Console is Blazor Server;
- set
Console:ForwardedHeaders:Enabledtotrueand list the proxy inKnownProxies. Sign-in rate limits and the audit log then see the real client IP. Without it, every client has the proxy’s address (loopback for a proxy on the same host), so one client’s failed sign-ins count against everyone’s per-IP limit.
To switch an existing install:
- Change
Console:Urlsin/opt/domainnotice/config/appsettings.Production.json. - Change
HEALTH_URLin/opt/domainnotice/config/update.env. sudo systemctl restart domainnotice.
What gets installed
| Path | Owner / mode | Content |
|---|---|---|
/opt/domainnotice/releases/<version>/ |
root, 755 | Program files |
/opt/domainnotice/current |
symlink | The running release |
/opt/domainnotice/config/appsettings.Production.json |
root:domainnotice 640 | Configuration |
/opt/domainnotice/config/console.pem, console.key |
root:domainnotice 640 | Console certificate |
/opt/domainnotice/config/update.env |
root 600 | Database settings for update.sh |
/opt/domainnotice/data/ |
domainnotice 700 | Agent-link key (keys/agent-link.pfx), Data Protection keys, package cache, staged updates |
/opt/domainnotice/backups/ |
root 700 | Archives from backup.sh; pre-update/ holds the pg_dump taken before each update. The server cannot read or write it. |
/opt/domainnotice/bin/update.sh, backup.sh |
root 755 | The updater and the backup script (replaced only by install.sh from a package you give it, see Updates) |
/etc/systemd/system/domainnotice.service |
The server (Type=notify, User=domainnotice, hardened) |
|
/etc/systemd/system/domainnotice-update.{path,service} |
Applies a staged self-update as root |
The installer also installs these apt packages: ca-certificates, curl, tar, the ICU and OpenSSL libraries,
libldap2 (needed for LDAP) and postgresql-client.
Logs go to the journal: journalctl -u domainnotice -f.
Maintenance: repair, upgrade, backup, restore, password reset, uninstall
Running sudo ./install.sh on an installed server shows a menu:
- repair;
- upgrade;
- backup;
- restore a backup;
- reset a local account’s password;
- uninstall;
- cancel.
Each item also has a flag:
| Command | Effect |
|---|---|
install.sh --repair |
Re-applies owners and modes and restarts the services; never overwrites config or data. Keeps the installed update.sh, backup.sh and units; with --package FILE or --version X.Y.Z it reinstalls them from that package |
install.sh --upgrade --package FILE |
Installs a newer release through the same path as the Console’s Update now |
install.sh --backup [--output PATH] |
Backs up the database, configuration, keys, data and the running program (see Backup and restore) |
install.sh --restore FILE |
Restores a backup on this server (asks for confirmation; --yes when unattended) |
install.sh --reset-password [USER] |
Sets a new password for a local Console account and enables it. Without USER it lists the accounts and asks. Unattended: DOMAINNOTICE_ADMIN_PASSWORD or --secrets-file. |
install.sh --uninstall |
Removes everything: program, services, /opt/domainnotice (config, keys, data, backups), the service user and the database |
install.sh --uninstall --keep-data |
Removes only the program and its services; keeps config, data, backups and the database |
--uninstall deletes the database with all announcements, confirmations, answers and history, and the agent-link key.
After that, every agent would need reinstalling. The installer warns, offers to write a backup to a file outside
/opt/domainnotice first, and asks you to type uninstall. Unattended runs need --yes, and can write the backup with
--backup-to FILE. A local database is dropped together with its role, and nothing else on that PostgreSQL. For an
existing (external) database, every table DomainNotice created is dropped; the database and role stay. --purge is an
alias of --uninstall.
After installing
- Sign in to the Console with the first local account.
- Settings → Enrolment: set the install password. Until one is set, every enrolment is refused while
Enrolment:RequirePasswordistrue. - Configure Active Directory.
- Deploy the agent with the fingerprint shown in Settings → Agent install.