Add install.sh: install or upgrade Megalodon as a systemd service
CI / test (push) Successful in 2m15s

Downloads the release for this machine and verifies its checksum (or builds
from source), creates the service user and folders, writes and opens the
environment file, installs the hardened unit and prints the first-run admin
password. Re-running upgrades; --uninstall [--purge] removes it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
VeillaxandClaude Sonnet 5.5 committed 2026-10-31 00:21:53 -06:00
1 parent 0d2cb31abf
commit 81e3f73521
2 files changed
+239 -1

No files matched your search

+16 -1
View File
@@ -59,7 +59,22 @@ password you set there is the RCON password.
admin password. Keep it on your LAN or a VPN; only Megalodon needs to reach it. If Megalodon and
the server are on the same machine or Docker network, nothing needs to be opened at all.
## Running it
## Installing on Linux (systemd)
```sh
curl -fsSL https://git.veillax.com/Veillax/megalodon/raw/branch/main/deploy/install.sh | sudo sh
```
This downloads the latest release (checking its SHA-256), installs `/usr/local/bin/megalodon`,
creates a `megalodon` user, `/etc/megalodon/` (settings) and `/var/lib/megalodon/` (data), opens
`/etc/megalodon/megalodon.env` in your editor, then starts the service and prints the first-run
admin password. Run it again to upgrade; your settings are kept.
Options: `--version v0.1.0`, `--listen 0.0.0.0:8480`, `--source` (build from the repository with Go
instead), `--no-edit`, `--no-start`, and `--uninstall` (add `--purge` to delete settings and data).
Download the script and read it first if you prefer: it is [`deploy/install.sh`](deploy/install.sh).
## Running it by hand
```sh
# download a release, or: go build ./cmd/megalodon