Installation
Installation
GO Shortener is distributed as a single precompiled binary for Linux systems (x86_64 and aarch64). No Go compiler, Docker, or Node.js environment is required on the production server.
Prerequisites
- Operating System: Ubuntu 22.04 LTS or 24.04 LTS (or any modern Linux distribution with
systemd). - Hardware: Minimum 512 MB RAM (1 GB recommended), 1 CPU core, 500 MB free disk space.
- Privileges: Root access or
sudoprivileges. - Port Availability: Port
3000(default) free for local binding.
Option A: Automated One-Line Installer (Recommended)
Run the official installer script as root. This script detects your server's CPU architecture, downloads the latest prebuilt release from GitHub, generates a production .env file, and installs the systemd service.
curl -fsSL https://raw.githubusercontent.com/ItsARCn/Go-shortner/main/scripts/install.sh | sudo bash
/root/Go-shortner with a randomly generated 32-character JWT_SECRET and creates the go-shortener.service automatically.Option B: Manual Binary Installation
If you prefer to configure the deployment manually, follow these steps:
1. Create the Application Directory
mkdir -p /root/Go-shortner/data
cd /root/Go-shortner
2. Download the Release Binary
Visit the GitHub Releases page and download the executable matching your architecture:
# For x86_64 / amd64 servers
curl -L -o go-shortener https://github.com/ItsARCn/Go-shortner/releases/latest/download/go-shortener-linux-amd64
# For aarch64 / arm64 servers
curl -L -o go-shortener https://github.com/ItsARCn/Go-shortner/releases/latest/download/go-shortener-linux-arm64
# Grant execute permissions
chmod +x go-shortener
3. Create the Production Environment File
Create /root/Go-shortner/.env and lock file permissions to prevent unauthorized reads:
cat << 'EOF' > /root/Go-shortner/.env
PORT=3000
HOST=127.0.0.1
BASE_URL=https://go.arcn.online
DB_PATH=/root/Go-shortner/data/go.sqlite
JWT_SECRET=$(openssl rand -hex 32)
SESSION_DURATION_HOURS=72
ANONYMOUS_DAILY_QUOTA=15
REGISTERED_MONTHLY_QUOTA=100
ANONYMOUS_MAX_EXPIRATION_DAYS=7
REGISTERED_MAX_EXPIRATION_DAYS=365
TURNSTILE_ENABLED=false
EOF
chmod 600 /root/Go-shortner/.env
4. Create the systemd Service File
Create /etc/systemd/system/go-shortener.service:
[Unit]
Description=GO Shortener - Minimal High-Performance URL Shortener
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/root/Go-shortner
ExecStart=/root/Go-shortner/go-shortener
Restart=always
RestartSec=3
LimitNOFILE=65535
# Security Hardening
PrivateTmp=true
[Install]
WantedBy=multi-user.target
5. Enable and Start the Service
systemctl daemon-reload
systemctl enable --now go-shortener
Verifying the Service
Check that the binary is actively listening on 127.0.0.1:3000:
# Verify systemd service status
systemctl status go-shortener
# Test internal health endpoint
curl http://127.0.0.1:3000/api/health
A healthy response will return {"status":"ok"}.