Fathom
·1 min
Detailed instructions here.
VERSION=1.2.1
OS=linux
ARCH=amd64
mkdir ~/my-fathom-site
cd ~/my-fathom-site
wget https://github.com/usefathom/fathom/releases/download/v${VERSION}/fathom_${VERSION}_${OS}_${ARCH}.tar.gz
sudo tar -C /usr/local/bin -xzf fathom_${VERSION}_${OS}_${ARCH}.tar.gz
sudo chmod +x /usr/local/bin/fathom
cat > .env << 'EOF'
FATHOM_SERVER_ADDR=9000
FATHOM_GZIP=true
FATHOM_DATABASE_NAME="fathom.db"
FATHOM_SECRET="..."
EOF
# Verify
fathom --version
fathom server
fathom user add --email="..." --password="..."
sudo bash -c 'cat > /etc/systemd/system/my-fathom-site.service << "EOF"
[Unit]
Description=Starts the fathom server
Requires=network.target
After=network.target
[Service]
Type=simple
User=ubuntu
Restart=always
RestartSec=3
WorkingDirectory=/home/ubuntu/my-fathom-site
ExecStart=/usr/local/bin/fathom server
[Install]
WantedBy=multi-user.target
EOF'
sudo systemctl daemon-reload
sudo systemctl enable my-fathom-site
sudo systemctl start my-fathom-site # Or just reboot.
sudo certbot --nginx -d fathom.flister.cf
Add the following to the relevant section of the Nginx config file and restart: sudo systemctl reload nginx
.
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:9000;
}