The smallest thing worth installing on a server of your own: a test for one-click installs

4 downloads

hello-server/install.sh
Install on DigitalOcean Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/hello-server.git
HTTPS
https://gitstable.com/git/askrobots/hello-server.git
SSH
ssh://git@gitstable.com:2222/askrobots/hello-server.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 hello-server 2026.11v1: the smallest thing worth installing on your own server 7298f7b 8 hours, 48 minutes ago History
install.sh · 1.4 KB · 44 lines
1#!/bin/sh
2# Install hello-server on a fresh Ubuntu server, at one version, as a service on port 80.
3# sh install.sh 2026.11v1 (a tag, a branch or a full commit id; default: the newest on main)
4# Safe to run again: it moves the copy to the version asked for and restarts the service.
5set -eu
6
7REF=${1:-main}
8REPO=${REPO:-https://gitstable.com/git/askrobots/hello-server.git}
9DIR=/opt/hello-server
10
11if [ ! -d "$DIR/.git" ]; then
12 git clone --quiet "$REPO" "$DIR"
13fi
14git -C "$DIR" fetch --quiet --tags origin
15git -C "$DIR" checkout --quiet --detach "$REF" 2>/dev/null || git -C "$DIR" checkout --quiet --detach "origin/$REF"
16
17COMMIT=$(git -C "$DIR" rev-parse HEAD)
18printf '{"version": "%s", "commit": "%s", "installed_at": "%s"}\n' \
19 "$REF" "$COMMIT" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" > "$DIR/installed.json"
20
21cat > /etc/systemd/system/hello-server.service <<UNIT
22[Unit]
23Description=hello-server (installed from $REPO at $REF)
24After=network-online.target
25Wants=network-online.target
26
27[Service]
28ExecStart=/usr/bin/python3 $DIR/server.py
29DynamicUser=yes
30AmbientCapabilities=CAP_NET_BIND_SERVICE
31NoNewPrivileges=yes
32ProtectSystem=strict
33ProtectHome=yes
34PrivateTmp=yes
35Restart=on-failure
36
37[Install]
38WantedBy=multi-user.target
39UNIT
40
41systemctl daemon-reload
42systemctl enable --quiet hello-server
43systemctl restart hello-server
44echo "hello-server $REF ($COMMIT) is running on port 80"