Skip to content

Deployment

This guide covers deploying OSGEO-Inject to production.

NixOS Anywhere Deployment

Prerequisites

  • Target server accessible via SSH
  • Root SSH access configured
  • Domain DNS pointing to server

Deployment Steps

  1. Prepare Configuration
# Edit your target configuration
vim nixos/vm-configuration.nix
  1. Deploy
nixos-anywhere --flake .#osgeo-inject-vm root@your-server-ip
  1. Verify
curl https://affiliate.osgeo.org/health

Manual Deployment

1. Build Assets

nix develop
npm ci
npm run build

2. Copy Files

rsync -avz src/ root@server:/var/www/osgeo-inject/
rsync -avz nginx/nginx.conf root@server:/etc/nginx/

3. Configure SSL

Using Let's Encrypt:

certbot certonly --nginx -d affiliate.osgeo.org

4. Start Services

ssh root@server "systemctl restart nginx"

Updating

Update Announcements

./scripts/update-announcement.sh --deploy

Update Static Assets

npm run build
rsync -avz src/ root@server:/var/www/osgeo-inject/

Full System Update

nixos-rebuild switch --flake .#osgeo-inject --target-host root@server

Rollback

NixOS supports instant rollbacks:

ssh root@server "nixos-rebuild switch --rollback"

Monitoring

Health Check

curl -f https://affiliate.osgeo.org/health || alert

Nginx Logs

ssh root@server "tail -f /var/log/nginx/access.log"

System Status

ssh root@server "systemctl status nginx matomo php-fpm"