Skip to content

Deployment Setup

This guide covers everything you need to deploy VaultSandbox: infrastructure requirements, DNS configuration, and automatic TLS certificate provisioning.

Required for: Production-parity testing

Why it matters:

  • ACME certificate issuance requires HTTP-01 or TLS-ALPN-01 challenge
  • Real SMTP servers need to connect to port 25 from the internet
  • SPF/DKIM validation requires legitimate DNS resolution

Without a public IP:

  • You can still run VaultSandbox locally for development
  • Email authentication checks will be limited

VaultSandbox requires the following ports to be accessible:

PortProtocolPurposeRequired For
25SMTPInbound emailEmail delivery
80HTTPACME challenges, Web UITLS certificates
443HTTPSSecure API and Web UIProduction use

Domain or Subdomain (Custom Domain Mode Only)

Section titled “Domain or Subdomain (Custom Domain Mode Only)”

Required for: Custom domain deployments

What you need:

  • A domain you control (e.g., example.com)
  • OR a subdomain (e.g., test.example.com or qa.example.com)
  • Access to modify DNS records (A and MX records)

Examples:

# Full domain for testing
example.com → VaultSandbox
# Subdomain for testing
qa.example.com → VaultSandbox

For custom domain deployments, you need the ability to create:

  1. A Record: Points your domain to the server’s IP address

    qa.example.com. A 192.0.2.1
  2. MX Record: Tells email servers where to deliver mail

    example.com. MX 10 qa.example.com.

VaultSandbox automatically provisions and renews TLS certificates using Let’s Encrypt - no manual configuration needed.

How it works:

  1. Configure your mode:

    VSX DNS:

    Terminal window
    VSB_VSX_DNS_ENABLED=true

    Custom Domain:

    Terminal window
    VSB_SMTP_ALLOWED_RECIPIENT_DOMAINS=qa.example.com
    VSB_CERT_ENABLED=true
  2. VaultSandbox requests certificates via HTTP-01 challenge

  3. Let’s Encrypt validates domain ownership (requires port 80 accessible)

  4. Certificate issued and automatically renewed 30 days before expiry

Requirements:

  • Port 80 accessible from internet (for ACME validation)
  • Port 443 accessible for HTTPS
  • DNS A record pointing to your server (custom domain only)

That’s it! HTTPS will be enabled automatically.

For light testing and development:

  • CPU: 1 core (2 cores recommended)
  • RAM: 1GB (2GB recommended)
  • Disk: 1GB for Docker images (VaultSandbox runs in-memory)
  • Network: 10 Mbps

Required versions:

  • Docker: 20.10+ (latest version recommended)
  • Docker Compose: 1.29+ or docker compose plugin (v2)

Installation:

Terminal window
# Check versions
docker --version
docker-compose --version
# or
docker compose version
# Install Docker (Ubuntu/Debian)
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Install Docker Compose v2 (plugin)
sudo apt-get update
sudo apt-get install docker-compose-plugin

VaultSandbox runs on any OS that supports Docker:

  • Linux: Ubuntu 20.04+, Debian 11+, CentOS 8+, Fedora 34+
  • macOS: macOS 11+ (for local development only)
  • Windows: Windows 10+ with WSL2 (for local development only)

Ensure your firewall allows:

Terminal window
# Allow SMTP (port 25)
sudo ufw allow 25/tcp
# Allow HTTP (port 80) - ACME challenges
sudo ufw allow 80/tcp
# Allow HTTPS (port 443)
sudo ufw allow 443/tcp
# Enable firewall
sudo ufw enable

If using cloud providers, configure security groups:

Inbound Rules:

  • Port 25 (SMTP) - Source: 0.0.0.0/0
  • Port 80 (HTTP) - Source: 0.0.0.0/0
  • Port 443 (HTTPS) - Source: 0.0.0.0/0
  • Port 22 (SSH) - Source: Your IP (for management)

Outbound Rules:

  • Allow all outbound (for ACME challenges and updates)

VaultSandbox works with any DNS provider. Popular options:

  • Cloudflare: Fast propagation, free tier available
  • AWS Route 53: AWS integration, programmable DNS
  • Google Cloud DNS: GCP integration
  • DigitalOcean DNS: Free with DigitalOcean droplets
  • Namecheap, GoDaddy, etc.: All standard DNS providers work

What it is: Maps an IP address back to a hostname

Why it helps:

  • Some sending SMTP servers check reverse DNS before delivering
  • Can improve email acceptance rates from strict servers
  • Generally optional for testing purposes

How to set it up:

  • Contact your hosting provider (usually requires support ticket)
  • Set PTR record: 192.0.2.1 → qa.example.com

Test reverse DNS:

Terminal window
dig -x 192.0.2.1
  • Public IP address acquired
  • Ports 25, 80, and 443 accessible (no NAT/firewall blocking)
  • Docker and Docker Compose installed
  • Public IP address acquired
  • Port 25 confirmed open (test with telnet/nc)
  • Ports 80 and 443 accessible
  • Domain or subdomain ready
  • DNS provider access confirmed
  • Docker and Docker Compose installed
  • Firewall rules configured
  • (Optional) Reverse DNS requested

Testing Without Public IP (Local Development)

Section titled “Testing Without Public IP (Local Development)”

You can run VaultSandbox locally for development:

Terminal window
docker-compose up

Limitations:

  • No TLS certificates (ACME requires public IP and domain)
  • Cannot receive emails from external SMTP servers
  • Must send test emails from same machine

For local testing:

Terminal window
# Send test email locally
swaks --to test@localhost \
--server localhost \
--port 25 \
--body "Local test"

Once you’ve confirmed all requirements and configured DNS:

  1. Docker Compose Setup - Deploy VaultSandbox with Docker
  2. Quick Start - Send your first test email
Terminal window
# From another machine
telnet YOUR_SERVER_IP 25
# Or using nc
nc -zv YOUR_SERVER_IP 25
# Expected output: "Connected to YOUR_SERVER_IP"

Options:

  1. Request unblocking (AWS, GCP support tickets)
  2. Switch to a VPS provider that allows port 25 (DigitalOcean, Hetzner, Linode)
  3. Use an SMTP relay service (not recommended for testing)
Terminal window
# Test A record
dig A qa.example.com
# Test MX record
dig MX example.com
# Use external DNS checker
https://dnschecker.org