Apply for Free VPS

Simple Git deployments without a platform

27 Nov 2026 git deployment

A small, repeatable release process with a health check and a way back.

You do not need a deployment platform to release safely. You need the same steps every time.

The goals

A release should be repeatable, checked and reversible.

Release folders

Check each version out into its own directory, build there, then switch a symbolic link:

release=/srv/app/releases/$(date +%Y%m%d%H%M%S)
git clone --depth 1 git@example.com:team/app.git "$release"
cd "$release" && npm ci && npm run build
ln -sfn "$release" /srv/app/current
sudo systemctl restart app
curl -fsS --retry 5 --retry-connrefused http://127.0.0.1:3000/health

Put set -euo pipefail at the top so a failed build never goes live.

Roll back

Point the link at the previous release and restart.

Keep state outside releases

Uploads, configuration and logs belong in shared folders linked into each release.

Database changes

Make them compatible with both the old and new code: add first, remove in a later release.

Clean up

Keep a handful of releases and delete older ones so the disk does not fill.

Who can deploy

Use a dedicated user with only the permissions the script needs.

Need a server to try this on?See VPS plans

More articles