This directory contains installation and image-building scripts for FlatRun.
Use Vagrant to test the installer in a clean Ubuntu VM.
# Add HashiCorp GPG key
wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
# Add repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
# Install Vagrant and VirtualBox
sudo apt update && sudo apt install -y vagrant virtualboxcd installer
# Start and provision the VM
vagrant up
# SSH into the VM
vagrant ssh
# Test the production install script
sudo /vagrant/scripts/install.sh
# Or test local dev builds
sudo /vagrant/scripts/dev-test-vagrant.sh- From host: http://localhost:8880/setup
- Direct VM: http://192.168.56.10/setup
- API (from host): http://localhost:8890/api
vagrant up # Start VM
vagrant ssh # SSH into VM
vagrant halt # Stop VM
vagrant destroy # Delete VM
vagrant reload # Restart VM# Inside VM: reset setup wizard
sudo /vagrant/scripts/dev-test-vagrant.sh reset
# Or destroy and recreate VM
vagrant destroy -f && vagrant upInstall FlatRun on any Ubuntu/Debian server with Docker:
curl -fsSL https://raw.githubusercontent.com/flatrun/flatrun/main/installer/scripts/install.sh | sudo bashOr with a specific version:
curl -fsSL https://raw.githubusercontent.com/flatrun/flatrun/main/installer/scripts/install.sh | sudo FLATRUN_VERSION=1.0.0 bash- Ubuntu 22.04 or Debian 12+
- Docker CE installed and running
- Root/sudo access
- Ports 80, 443, 8090 available
installer/
├── packer/
│ ├── builds/ # Platform-specific Packer templates
│ │ ├── digitalocean.pkr.hcl
│ │ └── aws.pkr.hcl
│ ├── scripts/ # Shared provisioning scripts
│ │ ├── 00-base-setup.sh
│ │ ├── 01-install-docker.sh
│ │ ├── 02-install-flatrun.sh
│ │ ├── 03-configure-nginx.sh
│ │ ├── 04-configure-systemd.sh
│ │ ├── 99-cleanup.sh
│ │ └── lib/
│ │ └── common.sh
│ └── variables.pkr.hcl # Shared Packer variables
├── cloud-init/
│ └── user-data.yaml # First-boot configuration
├── systemd/
│ └── flatrun-agent.service
├── nginx/
│ └── flatrun.conf
└── scripts/
├── install.sh # Manual install script
└── uninstall.sh # Uninstall script
cd packer/builds
# Set your DigitalOcean API token
export DIGITALOCEAN_TOKEN="your-token-here"
# Initialize Packer plugins
packer init digitalocean.pkr.hcl
# Build the image
packer build -var "version=1.0.0" digitalocean.pkr.hclcd packer/builds
# Set your AWS credentials
export AWS_ACCESS_KEY_ID="your-access-key"
export AWS_SECRET_ACCESS_KEY="your-secret-key"
# Initialize Packer plugins
packer init aws.pkr.hcl
# Build the AMI
packer build -var "version=1.0.0" aws.pkr.hcl- Copy an existing template from
packer/builds/ - Update the source block for the new cloud's API
- Update regions and base image configuration
- Run
packer build- uses the same shared scripts
The provisioning scripts are 100% shared across all platforms.
If you prefer to install manually:
# Download and run the install script
curl -fsSL https://raw.githubusercontent.com/flatrun/flatrun/main/installer/scripts/install.sh -o install.sh
chmod +x install.sh
sudo ./install.shcurl -fsSL https://raw.githubusercontent.com/flatrun/flatrun/main/installer/scripts/uninstall.sh | sudo bashOr manually:
sudo systemctl stop flatrun-agent
sudo systemctl disable flatrun-agent
sudo rm -rf /opt/flatrun /etc/flatrun
sudo rm /etc/systemd/system/flatrun-agent.service
sudo systemctl daemon-reloadAfter installation, complete the setup wizard at:
http://YOUR_SERVER_IP/setup
The setup wizard will guide you through:
- System requirements check
- Domain configuration
- Admin user creation
- SSL certificate setup (optional)
sudo systemctl status flatrun-agentsudo journalctl -u flatrun-agent -fsudo nginx -t
sudo systemctl status nginxdocker info
docker network ls