---
title: "Deploy Spug"
description: "Agentless ops platform: SSH hosts, batch jobs, deploys, cron and monitoring"
category: "Automation"
url: https://railway.com/deploy/spug
---

# Deploy Spug

Agentless ops platform: SSH hosts, batch jobs, deploys, cron and monitoring

**[Deploy Spug on Railway](https://railway.com/template/spug)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/spug/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Automation

## Template content

### Spug https://raw.githubusercontent.com/openspug/spug/v4.1.2/spug_web/public/logo.png

- **Source:** https://github.com/aalfath/spug-railway-template
- **Health check:** /api/account/login/
- **Public domain:** Yes

### MySQL https://devicons.railway.app/i/mysql.svg

- **Image:** mysql:8
- **Start command:** `docker-entrypoint.sh mysqld --innodb-use-native-aio=0 --disable-log-bin --performance_schema=0 --innodb-buffer-pool-size=128M`

## Documentation

# Deploy and Host Spug on Railway

Spug is an open-source, agentless ops platform for small and medium teams. From one web UI you keep an inventory of servers and reach them over SSH: run commands on many hosts at once, open a web terminal and file manager, deploy applications, run pipelines and scheduled tasks, manage configs, and monitor sites and ports with alerts.

## About Hosting Spug

Spug is a Django application with a React front end. Besides the web API it runs a websocket server for terminals and live logs, a job worker, a monitor and a scheduler, and it keeps its data in MySQL. This template runs the official Spug v4.1.2 image, pinned by digest and built from a public GitHub repo, next to Railway's MySQL. They talk over the private network, and each has its own volume. On first start Spug creates its schema and an admin account with a generated password, so there is no open setup page. The whole stack runs in about 0.3 GB of RAM.

## Common Use Cases

* Run the same command or script on a group of servers and see each host's output
* Deploy applications from Git to your servers, with approvals, rollbacks and pipelines
* Schedule recurring jobs and monitor websites, ports and processes with alerts

## Dependencies for Spug Hosting

* MySQL 8 (Railway's MySQL service, included)
* SSH access from Railway to the servers you want to manage

### Deployment Dependencies

* Spug source, releases and docs: https://github.com/openspug/spug
* Template repo (Dockerfile, start script, changelog): https://github.com/aalfath/spug-railway-template

### Implementation Details

Services in this template:

* **Spug**: web UI, API, websocket server, job worker, monitor and scheduler, with nginx and a private Redis in the same container. Built from `aalfath/spug-railway-template` (official image `openspug/spug:4.1.2` pinned by digest). Public HTTPS domain, health check on `/api/account/login/`, data volume at `/data`.
* **MySQL**: Railway's MySQL 8, holding Spug's users, hosts, credentials, apps, tasks and history on a volume at `/var/lib/mysql`.

After deploy:

1. Open the Spug service's public URL (the first start takes about a minute).
2. Log in as `admin` with the value of the Spug service's `SPUG_ADMIN_PASSWORD` variable, using the standard (not LDAP) login.
3. Change the password under your profile, then add your servers under Hosts.

There are no prompts: the admin and database passwords are generated. Alerts (email, webhooks, chat apps), LDAP and two-factor login are optional and set in Spug's System settings. Distributing files from a host and the pipeline data-transfer node need sshfs privileges that Railway doesn't grant, so those two features are not available; everything else works. If a Spug process keeps crashing, the container exits with an error so Railway restarts it.

Updates: the Spug service builds from the template repo. When the repo moves to a new Spug release, Railway shows an "update available" notice on your project and you choose when to apply it. Read the repo's CHANGELOG.md first; schema changes are applied on start. Back up the MySQL volume before a major upgrade.

## Why Deploy Spug on Railway?


Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Spug on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.



## Similar templates

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — Automate WhatsApp workflows with Evolution API, n8n, and Postgres.
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

Open this page in a browser: https://railway.com/deploy/spug
