/swarmlet

A self-hosted, open-source Platform as a Service that enables easy swarm deployments, load balancing, automatic SSL, metrics, analytics and more.

Primary LanguageShellMIT LicenseMIT

logo

Swarmlet

WebsiteDocumentationDemo 🧞‍♂

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.


stability-wip PRs Welcome

NOTE

Work In Progress.
This project is in beta and definitely not production-ready yet.

TL;DR

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.

What is Swarmlet?

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.

Getting started

  1. Create a new VPS running Ubuntu 18.04 x64 and log in as root
  2. Install Swarmlet (optionally with some swap if your server has less than 2gb of memory)
  3. Edit your SSH config to be able to use ssh swarm instead of ssh root@123.23.12.123
  4. Use an existing project, or clone one of the examples
  5. Add a docker-compose.yml file in the root of your project: example docker-compose.yml
  6. Add a git remote: git remote add swarm git@swarm:my-project
    (notice the syntax git@<name-configured-in-ssh-config>:<project-name>)
  7. Deploy your application stack to the swarm using git push swarm master
  8. 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

Installation

  • Requirements: Bash 4.0 or higher (run bash --version).

Quick interactive installation

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.

Examples

Swarmlet includes various examples of services that you can deploy to your server cluster with a simple git push.

All these examples and the Swarmlet documentation and website are running on a €5/mo single server 'cluster', using Swarmlet for deployments.


Proudly sponsored by Passionate People