https://github.com/MightyMoud/sidekick Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + GitHub Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions By size + Enterprise + Teams + Startups By industry + Healthcare + Financial services + Manufacturing By use case + CI/CD & Automation + DevOps + DevSecOps * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} MightyMoud / sidekick Public * Notifications You must be signed in to change notification settings * Fork 25 * Star 1.5k Bare metal to production ready in mins; your own fly server on your VPS. License GPL-3.0 license 1.5k stars 25 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 2 * Pull requests 2 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights MightyMoud/sidekick This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Name Name Last commit Last commit message date Latest commit History 35 Commits cmd cmd demo/imgs demo/imgs render render utils utils .gitignore .gitignore .goreleaser.yaml .goreleaser.yaml LICENSE LICENSE README.md README.md go.mod go.mod go.sum go.sum main.go main.go View all files Repository files navigation * README * GPL-3.0 license [68747470733a2f] [68747470733a2f] Bare metal to production ready in mins; imagine fly.io on your VPS [hero] GitHub GitHub go.mod Go version GitHub tag (latest SemVer) Features * One command VPS setup (docker, traefik, sops, age) * deploy any application from a dockerfile * Zero downtime deployment * High availability and load balancing * Zero config SSL Certs * Connect domains or use sslip.io out of the box * Built in integration with SOPS * Escape the vendorlock forever Motivation I'm tired of the complexity involved in hosting my side projects. While some platforms, like Fly.io, stand out in the crowded field of Heroku replacements, I believe a simple VPS can be just as effective. That's why I created Sidekick: to make hosting side projects as straightforward, affordable, and production-ready as possible. You'll be surprised how much traffic a $8/month instance on DigitalOcean can handle. Installation With GO installed on your system you need to run go install github.com/mightymoud/sidekick@latest Usage Sidekick helps you along all the steps of deployment on your VPS. From basic setup to zero downtime deploys, we got you! First you need a VPS with Ubuntu LTS. I recommend DigitalOcean. Hetzner also gets very good reviews. You can host your own silicon too. As long as you have a public IP address you can use Sidekick. Just make sure the following is true: * VPS running Ubuntu - LTS recommended * SSH Public Key available on your machine to login to VPS. That's it! VPS Setup [init] First you need to setup your VPS. To do this you need to run: sidekick init Then you need to enter the following: * IP Address of your VPS * An email address to use for setting up SSL certs * Docker registry to host your docker images - defaults to docker.io * Docker username in the said registry * Confirm you are currently logged in to that said registry with the username - This is needed to be able to push images on your behalf After that Sidekick will setup many things on your VPS - Usually takes around 2 mins What does Sidekick do when I run this command * Login with root user * Make a new user sidekick and grant sudo access * Logout from root and login with sidekick * Update and upgrade your Ubuntu system * Install sops and copy over the public key to your sidekick config file * Use age to make secret and public keys to use later for encrypting env file. * Send public key back to host machine to be used later for encryption * Install Docker * Setup Traefik and SSL certs on your VPS Launch a new application [launch] In your application folder, make sure you have a working Dockerfile that you can build and run. Also make sure you know at which port your app is expecting to receive traffic. Then run: sidekick launch Then you need to enter the following: * Url friendly name of your app - if you opt to use sslip.io domain for testing this would be your subdomain * HTTP exposed port for your app to get requests - Sidekick will scan your docker file to try to extract this number and default it. * Domain at which you want this application to be reachable - If you choose your own domain make sure to point the domain to your VPS IP address; otherwise we default to sslip.io domain so you can play around. * If you have any env file with secrets in it. Sidekick will attempt to find .env file in the root of your folder. Sidekick will use sops to encrypt your env file and inject the values securely at run time. Should take around 2 more mins to be able to visit your application live on the web if all goes well. What does Sidekick do when I run this command * Build your docker image locally for linux * Push the docker image to the registry * Encrypt your env file, if available and push it to your VPS * Use sops to dycrpt your env file and start and env with the values injected * Spin up your docker image using docker compose and route traffic to it using Traefik on the specified port Deploy a new version [deploy] With your application deployed, it's super simple to redeploy a new version. At any point any time you need to only run: sidekick deploy That's all. It won't take long, we use cache from earlier docker images, your latest version should be up soon. Sidekick will deploy the new version without any downtime - you can see more in the source code. This command will also do a couple of things behind the scenes. You can check that below What does Sidekick do when I run this command * Build your docker image locally for linux * Compare your latest env file checksum for changes from last time you deployed your application. * If your env file has changed, sidekick will re encrypt it and replace the encrypted.env file on your server. * Deploy the new version with zero downtime deploys so you don't miss any traffic. Deploy a preview environment [preview] Sidekick also allows you to deploy preview envs at any point from your application. Preview envs are attached to your commit hash and require a clean git tree before you can initiate them. Once you have a clean git tree, you can run the following command to deploy a preview environment: sidekick deploy preview What does Sidekick do when I run this command * Build your docker image locally for linux * Tag the new image with the short checksum of your git commit * Compare your latest env file checksum for changes from last time you deployed your application. * If your env file has changed, sidekick will re encrypt it and replace the encrypted.env file on your server. * Add a new folder inside your app folder called "preview" where Sidekick will store and manage all your preview deployments * Deploy a new version of your app reachable on a short hash based subdomain Inspiration * https://fly.io/ * https://kamal-deploy.org/ Vision Simple CLI tool that can help you: * Setup your VPS * Deploy all your side projects on a single VPS * Load balance multiple container per project * Deploy new versions with Zero downtime * Deploy preview environments with ease * Manage env secrets in a secure way * Connect any number of domains and subdomains to your projects with ease Remove sidekick You can easily remove sidekick if you hate it. // Mac/Linux cd $HOME/go/bin rm sidekick cd ~/.config rm -rf sidekick // Win cd %USERPROFILE%\go\bin del sidekick.exe // Powershell cd $HOME\go\bin Remove-Item sidekick.exe --------------------------------------------------------------------- Roadmap I still have a couple more feature I want to add here. Also considering some of those to be on a paid version. * Preview env deployments * A way to deploy more complicated projects defined in docker compose file * Better zero downtime deploys with watchtower * Firewall setup * Managing multiple VPSs * Easy way to deploy databases with one command * TUI for monitoring your VPS * Streaming down compose logs - ala fly logs * Auto deploy on image push - to work with CICD better About Bare metal to production ready in mins; your own fly server on your VPS. Topics heroku deployment self-hosted vps-admin self-hosting self-host vps-setup selfhosting vps-ubuntu vps-server self-hostable Resources Readme License GPL-3.0 license Activity Stars 1.5k stars Watchers 8 watching Forks 25 forks Report repository Releases 6 v0.5.3 Latest Sep 17, 2024 + 5 releases Packages 0 No packages published Contributors 2 * * Languages * Go 100.0% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.