Hobby is a command-line tool designed to simplify deploying and managing hobby projects on remote servers. It automates server setup, deployment, and updates using Docker Compose and Caddy as a reverse proxy.
- 🚀 One-command server setup
- 🔒 Automatic SSL/TLS with Caddy
- 🐳 Docker-based deployments
- 🔑 Secure environment variable handling with SOPS/age
- 🔄 Rolling updates
- 🌐 Automatic domain configuration with sslip.io
- A fresh Ubuntu server with SSH access
- Root access to the server
- SSH key-based authentication configured
- Docker installed locally
- A Dockerized project with:
- A valid
Dockerfile - The application listening on a single port
- (Optional)
.envfile for environment variables
- A valid
my-project/
├── Dockerfile
├── src/
├── .env (optional)
└── hobby.yml <- Hobby configuration generated after running `hobby setup`
FROM node:18-alpine
WORKDIR /app
COPY . .
RUN npm install
EXPOSE 8080
CMD ["npm", "start"]-
Download the latest binary for your platform from the releases page
-
Make it executable and move it to your PATH:
# Linux/macOS
chmod +x hobby
sudo mv hobby /usr/local/bin/If you have Rust installed and want to build from source:
# Clone and build
git clone https://github.com/yourusername/hobby
cd hobby
cargo install --path .- Buy yourself an Ubuntu VM / VPS.
I usually do this from Hetzner and pick the cheapest one to start out with. Add your personal SSH key to the server, Hobby CLI will use that to log in as root the first time.
- Initialize your server:
hobby setup your-server-ip- Configure your application:
Edit
hobby.ymlin your project directory:
name: "myapp" <- Change to your application name
version: "V0"
port: 8080 <- Change to your application port
server: your-server-ip
url: myapp.your-server-ip.sslip.io <- Change your application URL if needed- Launch your application:
hobby launch- Deploy updates:
hobby deployname: "myapp" # Your application name
version: "V0" # Version tag (automatically incremented)
port: 8080 # Application port
server: 1.2.3.4 # Server IP address
url: myapp.example.com # Application URL# hobby.yml
name: "myapp"
# ...
env:
file: .env # Path to your environment file# hobby.yml
name: "myapp"
# ...
volumes:
- dbdata:/app/datahobby setup <server-ip>: Initialize server with Docker, Caddy, and security configurationshobby launch: First-time deployment of your applicationhobby deploy: Deploy updates to your application
-
Setup: Configures server with:
- Secure hobby user
- Docker and Docker Compose
- Caddy reverse proxy
- SOPS/age encryption for secrets
-
Launch: First deployment:
- Builds Docker image
- Creates Docker Compose configuration
- Sets up Caddy routing
- Configures SSL/TLS
-
Deploy: Updates existing deployment:
- Builds new image
- Updates containers with zero downtime
- Maintains persistent volumes
- Updates environment variables if changed
- Automatic SSL/TLS certificates
- Environment variable encryption
- Non-root user deployment
- SSH hardening
Contributions are welcome! Please feel free to submit a Pull Request.