Getting Started

Updating

Update GO Shortener to a newer release safely without downtime or data loss.

Updating

Because GO Shortener compiles into a standalone, single-executable binary with embedded frontend assets, upgrading to a new version is simple and carries zero risk of overwriting your configuration or stored data.

Safety Guarantee: Upgrades never overwrite your existing SQLite database (/root/Go-shortner/data/go.sqlite) or your .env configuration file.

Method 1: Automated Update via Installer Script

If you installed GO using the official installer script, rerun the script directly on your server:

Terminal
sudo bash /root/Go-shortner/install.sh

The script automatically:

  1. Detects your CPU architecture.
  2. Queries the GitHub API for the latest release tag.
  3. Stops go-shortener.service.
  4. Replaces /root/Go-shortner/go-shortener with the new binary.
  5. Preserves .env and all SQLite database files intact.
  6. Restarts go-shortener.service and checks health.

Method 2: Manual Update Process

Follow this recommended 7-step procedure to perform a controlled manual upgrade:

1. Download the New Release Binary

Download the latest prebuilt binary from the GitHub Releases page to a temporary location:

Terminal
# For x86_64 servers
curl -L -o /tmp/go-shortener-new https://github.com/ItsARCn/Go-shortner/releases/latest/download/go-shortener-linux-amd64

# For ARM64 servers
curl -L -o /tmp/go-shortener-new https://github.com/ItsARCn/Go-shortner/releases/latest/download/go-shortener-linux-arm64

# Ensure executable permissions
chmod +x /tmp/go-shortener-new

2. Stop the Application Service

Gracefully stop the running systemd service:

Terminal
systemctl stop go-shortener

3. Replace the Binary

Move the new binary into place, overwriting the previous executable:

Terminal
mv /tmp/go-shortener-new /root/Go-shortner/go-shortener

4. Preserve the .env Configuration

Confirm that /root/Go-shortner/.env remains untouched and contains your existing JWT_SECRET and keys.

Terminal
# Verify configuration exists and permissions are intact
ls -l /root/Go-shortner/.env

5. Preserve the SQLite Database

Confirm that your SQLite database directory /root/Go-shortner/data/ has not been modified:

Terminal
# Verify database files are present
ls -lh /root/Go-shortner/data/go.sqlite

6. Start the Service

Start the updated application service:

Terminal
systemctl start go-shortener

7. Verify the Service

Check the service status and inspect the health check endpoint:

Terminal
# Check systemd status
systemctl status go-shortener

# Query the internal health endpoint
curl -s http://127.0.0.1:3000/api/health

Rollback Procedure

If you ever encounter an issue with a new release:

  1. Stop the service: systemctl stop go-shortener
  2. Download the previous release binary tag from GitHub releases (e.g. v1.0.0).
  3. Replace /root/Go-shortner/go-shortener.
  4. Restart the service: systemctl start go-shortener.
  5. Your database and environment configuration remain untouched.
Copyright © 2026