Skip to content

DevOps scripts for self-hosting on a VPS with Docker/Podman

License

Notifications You must be signed in to change notification settings

ottojs/devops-selfhost

Repository files navigation

Otto.js DevOps - SelfHost

Requirements

  • Debian 12
  • Root access

Usage

  1. Edit and run install.sh on remote machine
  2. Upload certificate files in combo form cert chain + key in one file to /etc/ssl/private/
  3. Run on remote machine find /etc/ssl/private/ -name *combo > /etc/ssl/private/list.txt to generate certificate list
  4. Locally, edit haproxy-generator/main.go with your services
  5. Run go run haproxy-generator/main.go to generate 3 files. haproxy.cfg, docker-compose.yml, and update.sh
  6. Upload haproxy.cfg to /etc/haproxy/haproxy.cfg
  7. Upload docker-compose.yml and update.sh to home directory (/root)
  8. Upload docker-compose-systemd.service to /etc/systemd/system/docker-compose-systemd.service
  9. Run systemctl daemon-reload to pick up the new file /etc/systemd/system/docker-compose-systemd.service
  10. Run systemctl enable haproxy to start it at boot.
  11. Run systemctl enable docker-compose-systemd to start podman compose at boot.
  12. Build and save your service container images to tar files (see below)
  13. Upload your service name tar files to home directory (/root)
  14. Run ./update.sh to import the container and restart services (see that script for details)

Building Service Containers

# Build
podman build -t myservice:latest .;
# Export
podman save -o myservice.tar localhost/myservice:latest;
# Upload
scp myservice.tar root@[IP_OR_HOST_HERE]:;
# Import
ssh root@[IP_OR_HOST_HERE] "./update.sh";

About

DevOps scripts for self-hosting on a VPS with Docker/Podman

Resources

License

Stars

Watchers

Forks

Releases

No releases published