Senate

Multi-Server Setup

Deploy Senate across multiple machines for scalability and redundancy

Multi-Server Setup

Scale your infrastructure by deploying services across multiple machines. This guide covers adding remote servers, distributing workloads, and best practices for multi-server architectures.

Overview

Senate supports deploying to:

  • Local machine: The server running Senate
  • Remote machines: Any server accessible via SSH

Benefits of multi-server setups:

  • Scalability: Distribute load across machines
  • Isolation: Separate environments (dev/staging/prod)
  • Redundancy: No single point of failure
  • Geographic distribution: Deploy closer to users

Prerequisites

Before adding remote machines:

Each remote machine needs Docker installed and SSH access configured.

Remote Server Requirements

  • Linux server (Ubuntu, Debian, CentOS, etc.)
  • Docker installed and running
  • SSH access (port 22 or custom)
  • User with Docker permissions

Install Docker on Remote Server

When you add a remote machine that doesn't have Docker installed, Senate will detect this and prompt you to install Docker directly from the dashboard. Simply click the install button and Senate will handle the installation automatically.

Adding a Remote Machine

Open Machines page

Navigate to Machines in Senate dashboard.

Click Add Machine

Fill in the connection details:

FieldDescription
NameFriendly name (e.g., prod-server-1)
HostIP address or hostname
PortSSH port (default: 22)
UserSSH username

Add server dialog

Configure authentication

Choose SSH key (recommended) or password authentication.

Generate SSH key (if using keys)

Click "Generate Key" to create a new key pair. Copy the public key.

Add public key to remote server

# On the remote server
mkdir -p ~/.ssh
echo "ssh-ed25519 AAAA... senate-generated" >> ~/.ssh/authorized_keys

Test and save

Click "Add Machine" to test the connection and save.

Architecture Patterns

Pattern 1: Single App, Multiple Servers

Scale a single application horizontally:

┌─────────────────────────────────────────┐
│            Load Balancer                │
└─────────────────┬───────────────────────┘

    ┌─────────────┼─────────────┐
    ▼             ▼             ▼
┌────────┐   ┌────────┐   ┌────────┐
│Server 1│   │Server 2│   │Server 3│
│ App    │   │ App    │   │ App    │
└────────┘   └────────┘   └────────┘

Pattern 2: Microservices Distribution

Distribute services across specialized servers:

┌──────────────┐   ┌──────────────┐   ┌──────────────┐
│   Server 1   │   │   Server 2   │   │   Server 3   │
│   Frontend   │   │   Backend    │   │   Database   │
│   Gateway    │   │   Workers    │   │   Cache      │
└──────────────┘   └──────────────┘   └──────────────┘

Pattern 3: Environment Separation

Isolate environments on different servers:

┌──────────────┐   ┌──────────────┐   ┌──────────────┐
│  Dev Server  │   │ Staging Srv  │   │  Prod Server │
│  All apps    │   │  All apps    │   │  All apps    │
│  (develop)   │   │  (staging)   │   │  (main)      │
└──────────────┘   └──────────────┘   └──────────────┘

Deploying to Specific Machines

When Creating a Service

  1. In New Service form
  2. Select target machine from dropdown
  3. Create service

The service will deploy to the selected machine only.

Cross-Machine Communication

Using Public Domains

Services communicate via public URLs:

// Service on Server 1 calling Server 2
const response = await fetch('https://api.example.com/data');

Private Networking

Coming Soon: Built-in WireGuard support for secure private networking between your servers. This feature will allow your services to communicate securely over private IPs without exposing them to the public internet.

Troubleshooting

Cannot connect to remote machine

  1. Test SSH manually: ssh user@host
  2. Check firewall allows port 22
  3. Verify SSH key is in authorized_keys
  4. Check Docker is running on remote

On this page