Website — Documentation — Demo 🧞♂
Swarmlet is a self-hosted, open-source Platform as a Service that runs on any single server. It's mainly intended for use with multiple servers, a server cluster / swarm. Heavily inspired by Dokku.
Work In Progress.
This project is in beta and definitely not production-ready yet.
- Project boards: https://github.com/orgs/swarmlet/projects
- Join us on Slack: https://join.slack.com/t/swarmlet/shared_invite/zt-eki9qa53-9FdvUik604rncp61dbawkQ
Install swarmlet
on a server. Develop projects locally, describe your project application stack in a docker-compose.yml
file and simply git push swarm master
to deploy the project on your swarm (server cluster). A load balancer, SSL, and metrics/logging are enabled by default.
Swarmlet is a thin wrapper around Docker Compose and Docker Swarm mode.
Traefik, Let's Encrypt, Matamo, Swarmpit, Swarmprom and Portainer are included by default.
Swarmlet uses these to provide automatic SSL, load balancing, analytics and various metrics dashboards.
This project is aimed at developers that want to experiment with application deployment in a flexible multi-server / high-availability environment. The goal is to be able to set up your own swarm and deploy your app(s) in minutes.
- Create a new VPS running Ubuntu 18.04 x64 and log in as root
- Install Swarmlet (optionally with some swap if your server has less than 2gb of memory)
- Edit your SSH config to be able to use
ssh swarm
instead ofssh [email protected]
- Use an existing project, or clone one of the examples
- Add a
docker-compose.yml
file in the root of your project: example docker-compose.yml - Add a git remote:
git remote add swarm git@swarm:my-project
(notice the syntaxgit@<name-configured-in-ssh-config>:<project-name>
) - Deploy your application stack to the swarm using
git push swarm master
- SSL certificates for web facing services are generated automatically using Let's Encrypt
(assuming you've assigned a domain to your server in your DNS configuration)
Example application setup and deployment guide
- Requirements: Bash 4.0 or higher (run
bash --version
).
Full installation instructions can be found here
Make sure you have a (sub) domain available which is pointed to your server, this is necessary to access the included dashboards such as Swarmpit or Matomo.
To install the latest version of Swarmlet, log in to your server as root and run:
curl -fsSL https://get.swarmlet.dev | bash
Headless installation (options)
# Headless (noninteractive) installation:
curl -fsSL https://get.swarmlet.dev | bash -s \
INSTALLATION_TYPE=noninteractive \
INSTALL_ZSH=true \
CREATE_SWAP=true \
INSTALL_MODULES="(matomo swarmpit)" \
NEW_HOSTNAME=swarm-manager-1 \
SWARMLET_USERNAME=admin \
SWARMLET_PASSWORD=nicepassword \
ROOT_DOMAIN=dev.mydomain.com
# Install a different branch
BRANCH=develop
curl -fsSL https://raw.githubusercontent.com/swarmlet/swarmlet/$BRANCH/install | bash -s \
INSTALL_BRANCH=$BRANCH \
INSTALLATION_TYPE=interactive
The installation should take a few minutes to complete.
Swarmlet includes various examples of services that you can deploy to your server cluster with a simple git push
.
- swarmlet-website - The swarmlet.dev website
- get-swarmlet - The get.swarmlet.dev install script
- Basic example - Static site
- Basic example - Python web server + Redis
- Moderate example - NGINX + React app + Node.js API
- (FIX) Advanced example - NGINX + React app + Node.js API + CMS + staging/production
- Portainer Edge Agent
- (FIX) GitLab CE (self-hosted)
- (FIX) GitLab Runner (self-hosted)
- (TODO) HAProxy (Replacing Traefik with HAProxy)
All these examples and the Swarmlet documentation and website are running on a €5/mo single server 'cluster', using Swarmlet for deployments.