Skip to content

flatrun/installer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlatRun Installer

This directory contains installation and image-building scripts for FlatRun.

Development Testing with Vagrant

Use Vagrant to test the installer in a clean Ubuntu VM.

Install Vagrant (Ubuntu)

# 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 virtualbox

Start the Test VM

cd 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

Access FlatRun

Vagrant Commands

vagrant up        # Start VM
vagrant ssh       # SSH into VM
vagrant halt      # Stop VM
vagrant destroy   # Delete VM
vagrant reload    # Restart VM

Reset and Retest

# Inside VM: reset setup wizard
sudo /vagrant/scripts/dev-test-vagrant.sh reset

# Or destroy and recreate VM
vagrant destroy -f && vagrant up

Quick Install

Install FlatRun on any Ubuntu/Debian server with Docker:

curl -fsSL https://raw.githubusercontent.com/flatrun/flatrun/main/installer/scripts/install.sh | sudo bash

Or with a specific version:

curl -fsSL https://raw.githubusercontent.com/flatrun/flatrun/main/installer/scripts/install.sh | sudo FLATRUN_VERSION=1.0.0 bash

Prerequisites

  • Ubuntu 22.04 or Debian 12+
  • Docker CE installed and running
  • Root/sudo access
  • Ports 80, 443, 8090 available

Directory Structure

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

Building Cloud Images

DigitalOcean

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.hcl

AWS

cd 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

Adding New Cloud Providers

  1. Copy an existing template from packer/builds/
  2. Update the source block for the new cloud's API
  3. Update regions and base image configuration
  4. Run packer build - uses the same shared scripts

The provisioning scripts are 100% shared across all platforms.

Manual Installation

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.sh

Uninstallation

curl -fsSL https://raw.githubusercontent.com/flatrun/flatrun/main/installer/scripts/uninstall.sh | sudo bash

Or 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-reload

Post-Installation

After installation, complete the setup wizard at:

http://YOUR_SERVER_IP/setup

The setup wizard will guide you through:

  1. System requirements check
  2. Domain configuration
  3. Admin user creation
  4. SSL certificate setup (optional)

Troubleshooting

Check service status

sudo systemctl status flatrun-agent

View logs

sudo journalctl -u flatrun-agent -f

Check Nginx configuration

sudo nginx -t
sudo systemctl status nginx

Verify Docker

docker info
docker network ls

About

Official flatrun installer configs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published