Self-Hosted Infrastructure Runbook

Build Your Own Private Cloud

A complete, standalone engineering walkthrough to build a zero-cost, zero-public-ingress personal cloud on Oracle Cloud Infrastructure (OCI), Tailscale, Coolify, Traefik, and Cloudflare for $0.00/month in ongoing cloud spend.

Zero Public Ports Open Automated Wildcard HTTPS Daily Encrypted R2 Backups 2 OCPUs / 12 GB RAM ARM64
Section 1

Architecture Overview & Cost Breakdown

By the end of this guide, you will have a production-grade personal cloud with five core properties:

  1. Zero Public Attack Surface: Your ARM64 server runs on Oracle Cloud with zero public ports open to the internet. Both the cloud firewall (OCI VCN Security List) and host firewall (ufw) drop all unsolicited public traffic.
  2. Private Encrypted Mesh Access: You access your server's shell and web applications exclusively over Tailscale (WireGuard) from your laptop, desktop, or phone.
  3. Self-Hosted PaaS with Automated Wildcard HTTPS: Coolify manages your Docker apps and databases while Traefik serves every app at https://<app>.yourdomain.com using a single, auto-renewing Let's Encrypt wildcard certificate obtained via the Cloudflare DNS-01 challenge—no public port 80 or 443 required.
  4. Automated Off-Server Backups: Coolify runs daily encrypted backups both locally and off-site to Cloudflare R2 (S3-compatible object storage), capped at 8 GB to stay inside R2's free tier.
  5. Out-of-Band Email Alerting: Server health, disk usage, and backup failure alerts are sent through Cloudflare Email Service on an isolated alerts.yourdomain.com subdomain so your main yourdomain.com domain remains untouched for regular email hosting.

Interactive Architecture & Traffic Flow

Click any component below to jump directly to its setup phase. All inbound public traffic is dropped at OCI + UFW.

Ongoing Monthly Cost Breakdown

Component Service / Tier Monthly Cost
Compute & Storage OCI Always Free (VM.Standard.A1.Flex, 2 OCPUs, 12 GB RAM, 100 GB @ 10 VPU) $0.00
Private Mesh VPN Tailscale Personal Free Plan (up to 100 devices) $0.00
DNS & TLS Certificates Cloudflare Free DNS + Let's Encrypt Wildcard ACME $0.00
Off-Server Backups Cloudflare R2 Free Tier (10 GB/month storage; capped at 8 GB) $0.00
Transactional Alerting Cloudflare Email Service Free Tier (verified destinations) $0.00
PaaS Control Plane Coolify (Self-Hosted Open Source) $0.00
Total Ongoing Cloud Spend Excludes only your existing annual domain registration fee $0.00/month
Section 2

Prerequisites & Free Accounts Checklist

Have all five items ready before starting Phase 1:

  1. A Domain Name on Cloudflare DNS: Any domain you own (yourdomain.com), added to Cloudflare on the Free plan with DNS Setup: Full (Cloudflare nameservers active at your registrar).
  2. A Free Cloudflare Account: Used for DNS, R2 object storage (10 GB/month free tier; requires a payment method on file to activate R2, with $0.00 billed while under 10 GB), and Email Service.
  3. A Free Tailscale Account: Personal plan (free for up to 100 devices). Install and sign in to the Tailscale app on your primary computer (and your phone if you want mobile access to your hosted apps).
  4. An Oracle Cloud Infrastructure (OCI) Account:
    • Always Free Ampere A1 Allowance: OCI provides 1,500 OCPU hours and 9,000 GB hours per month of VM.Standard.A1.Flex compute for free. Running 2 OCPUs and 12 GB of RAM continuously 24/7 uses ~1,488 OCPU hours and ~8,928 GB hours in a 31-day month—fitting cleanly inside the free allowance at $0.00/month. Do not exceed 2 OCPUs or 12 GB RAM, or your monthly free hours will run out mid-month and trigger charges.
    • Strongly Recommended — Upgrade to Pay-As-You-Go (PAYG) with a $1.00 Budget Alert: Immediately after creating your OCI Free Tier account, upgrade it to Pay-As-You-Go and create a $1.00 monthly budget alert under Billing & Cost Management → Budgets. PAYG eliminates the common "Out of Host Capacity" error when provisioning ARM64 VMs and prevents Oracle from reclaiming idle Always Free instances. As long as your resources stay strictly within Always Free limits, your monthly bill remains $0.00.
  5. A Password Manager: Needed to store generated Cloudflare API tokens and Coolify's database backup encryption key (APP_KEY) off-server.
Prerequisites Checklist
Phase 1

Provision the Free OCI ARM64 Server

Step 1.1: Create a Virtual Cloud Network (VCN)

If your OCI compartment does not already have a VCN with internet access:

  1. In the OCI Console, open Networking → Virtual Cloud Networks.
  2. Click Start VCN Wizard → Create VCN with Internet Connectivity → Start VCN Wizard.
  3. Give the VCN a name (for example, private-cloud-vcn), keep the default CIDR blocks, and click Next → Create.

Step 1.2: Launch the VM.Standard.A1.Flex Instance

  1. Navigate to Compute → Instances → Create Instance.
  2. Configure the instance with these exact settings:
    • Name: my-private-cloud
    • Image: Click Change Image, select Canonical Ubuntu, and choose Ubuntu 24.04 (aarch64 / ARM64).
    • Shape: Click Change Shape, select Ampere, check VM.Standard.A1.Flex, and set:
      • Number of OCPUs: 2
      • Amount of memory (GB): 12
    • Networking: Select your VCN and its Public Subnet, and ensure Assign a public IPv4 address is enabled (temporary for initial bootstrap only).
    • Add SSH keys: Select Generate a key pair for me and click Save Private Key (saves a file like ssh-key-YYYY-MM-DD.key to ~/Downloads).
    • Boot Volume: Check Specify a custom boot volume size, set Boot volume size (GB) to 100, and leave Volume Performance strictly at 10 VPU (Balanced).
  3. Click Create and wait ~2 minutes for the instance state to reach Running.
  4. Copy the instance's Public IP address (YOUR_SERVER_PUBLIC_IP) from the Instance Details page.
Cost Warning — Keep Boot Volume at 10 VPU

Increasing Volume Performance above 10 VPU incurs billable per-GB charges even on Free Tier. A 100 GB boot volume uses half of OCI's 200 GB Always Free storage limit, leaving 100 GB of free headroom.

Step 1.3: Initial SSH Login & OS Update

From your local computer's terminal, secure the downloaded SSH key and connect:

bash — local terminal
# Lock down permissions on the downloaded SSH key
chmod 400 ~/Downloads/ssh-key-*.key

# Connect to the server over its temporary public IP
ssh -i ~/Downloads/ssh-key-*.key ubuntu@YOUR_SERVER_PUBLIC_IP

Once connected, update all Ubuntu packages:

bash — server
sudo apt update && sudo apt upgrade -y

Verification

Run the following commands on the server to confirm ARM64 architecture, memory, and disk allocation:

bash — server
uname -m
free -h
df -h /
Phase 1 Verification
Phase 2

Lock Down Networking with Tailscale & UFW (Zero Public Ports)

Step 2.1: Install Tailscale & Enable Tailscale SSH

On the server, install Tailscale and authenticate with Tailscale SSH enabled:

bash — server
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up --ssh

Open the authentication URL printed in the terminal in your browser and authorize the server on your Tailnet.

Step 2.2: Record Your Permanent Tailscale IP

bash — server
tailscale ip -4

Record the printed 100.x.y.z address (and paste it into the Personalizer panel at the top of this page).

Step 2.3: Verify Tailscale SSH Before Closing Public Access

Do Not Skip This Verification

Open a new terminal window on your local computer (with Tailscale running and connected) and confirm SSH works over Tailscale before enabling UFW or removing OCI ingress rules.

bash — new local terminal
ssh ubuntu@100.x.y.z

Confirm you land on the server's shell without using -i ~/Downloads/ssh-key-*.key. Keep this Tailscale SSH session open for the remaining steps.

Step 2.4: Lock Down the Host Firewall (ufw)

In your Tailscale SSH session, drop all inbound public traffic and allow inbound connections exclusively over tailscale0:

bash — server (via Tailscale SSH)
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow in on tailscale0
sudo ufw --force enable
sudo ufw status verbose

Confirm the output shows Status: active, Default: deny (incoming), allow (outgoing), and Anywhere on tailscale0 ALLOW IN Anywhere.

Step 2.5: Delete All Public Ingress Rules in OCI

Because Docker directly modifies iptables for published container ports, also close all public ports at the OCI cloud network layer:

  1. In the OCI Console, open Compute → Instances → my-private-cloud.
  2. Click the linked Subnet under Primary VNIC (for example, Public Subnet-...).
  3. Click the attached Security List (for example, Default Security List for ...).
  4. Under Ingress Rules, select all rules (including TCP port 22) and click Remove. Zero ingress rules should remain.
  5. Leave Egress Rules untouched (0.0.0.0/0 All Protocols) so your server can pull Docker images, renew TLS certificates, upload backups to R2, and send email alerts.

Verification

From your local computer's terminal, confirm public ingress times out while Tailscale SSH connects cleanly:

bash — local terminal
# 1. Confirm public ingress times out (zero public ports open)
curl -I --connect-timeout 5 https://YOUR_SERVER_PUBLIC_IP
nc -zv -w 5 YOUR_SERVER_PUBLIC_IP 22

# 2. Confirm Tailscale SSH connects cleanly
ssh ubuntu@100.x.y.z "hostname && tailscale ip -4"
Phase 2 Verification
Phase 3

Install Coolify via Temporary Tailscale Serve

Step 3.1: Run the Coolify Installer

In your Tailscale SSH session (ssh ubuntu@100.x.y.z), run Coolify's official installer (this automatically installs Docker Engine and starts Coolify on 127.0.0.1:8000):

bash — server
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | sudo bash

Wait 2–4 minutes for installation to finish.

Step 3.2: Temporarily Expose Coolify Over Tailscale HTTPS

Expose Coolify's local port 8000 over Tailscale HTTPS on port 8443 so your initial administrator registration is encrypted without opening any public ports:

bash — server
sudo tailscale serve --bg --https=8443 http://127.0.0.1:8000

Tailscale prints a private HTTPS URL in the format https://<hostname>.<tailnet>.ts.net:8443.

Step 3.3: Register Your Coolify Administrator Account

  1. Open https://<hostname>.<tailnet>.ts.net:8443 in your browser (with Tailscale active).
  2. Immediately register your Root Team administrator account using your verified email (you@example.com) and a strong password saved in your password manager.
  3. Complete the onboarding wizard by selecting Localhost as your managed server.
Phase 3 Verification
Phase 4

Configure Cloudflare DNS & Wildcard TLS (*.yourdomain.com)

This phase maps yourdomain.com and every *.yourdomain.com subdomain to your private Tailscale IP (100.x.y.z) and configures Traefik to maintain a single Let's Encrypt wildcard certificate via Cloudflare DNS-01.

Step 4.1: Add Cloudflare DNS Records

In Cloudflare Dashboard → yourdomain.com → DNS → Records, create two A records:

Type Name Content (Target) Proxy Status TTL
A @ (yourdomain.com) 100.x.y.z DNS only (grey cloud / unproxied) Auto
A * (*.yourdomain.com) 100.x.y.z DNS only (grey cloud / unproxied) Auto
Why DNS Only (Grey Cloud)?

Cloudflare's orange-cloud proxy cannot route to private Tailscale IP addresses (100.64.0.0/10). Returning 100.x.y.z directly via DNS lets Tailnet devices connect seamlessly over WireGuard while keeping non-Tailnet devices unable to reach the IP.

Step 4.2: Create a Zone-Scoped DNS API Token (coolify-traefik-dns)

  1. In Cloudflare Dashboard, click your profile icon → My Profile → API Tokens → Create Token.
  2. Click Get started next to Create Custom Token and configure:
    • Token Name: coolify-traefik-dns
    • Permissions: Zone → Zone → Read and Zone → DNS → Edit
    • Zone Resources: Include → Specific zone → yourdomain.com
  3. Click Continue to summary → Create Token, copy the token immediately, and save it in your password manager as CF_DNS_API_TOKEN.

Step 4.3: Enable Cloudflare DNS-01 in Coolify's Traefik Proxy

  1. In Coolify, go to Servers → localhost → Proxy → Configuration (docker-compose.yml).
  2. Inside the traefik service command: list, add these DNS-01 flags (and remove any conflicting httpchallenge flags if present):
yaml — traefik command flags
      - '--certificatesresolvers.letsencrypt.acme.dnschallenge=true'
      - '--certificatesresolvers.letsencrypt.acme.dnschallenge.provider=cloudflare'
      - '--certificatesresolvers.letsencrypt.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53'
  1. Under the traefik service, add (or update) the environment: block with your token:
yaml — traefik environment
    environment:
      - CF_DNS_API_TOKEN=YOUR_CF_DNS_API_TOKEN
  1. Click Save, then click Restart Proxy.

Step 4.4: Create the Wildcard Dynamic Router

Creating a priority: 1 catch-all router with service: noop@internal ensures Traefik proactively requests and auto-renews a single wildcard certificate for yourdomain.com and *.yourdomain.com while individual services claim their exact subdomains at higher priority.

bash — server (/data/coolify/proxy/dynamic/wildcard.yaml)
sudo mkdir -p /data/coolify/proxy/dynamic
sudo tee /data/coolify/proxy/dynamic/wildcard.yaml > /dev/null <<'EOF'
http:
  routers:
    wildcard-domain:
      rule: "Host(`yourdomain.com`) || HostRegexp(`^.+\\.yourdomain\\.com$`)"
      entryPoints:
        - https
      priority: 1
      service: noop@internal
      tls:
        certResolver: letsencrypt
        domains:
          - main: "yourdomain.com"
            sans:
              - "*.yourdomain.com"
EOF
sudo chmod 644 /data/coolify/proxy/dynamic/wildcard.yaml

Wait 30–60 seconds for Traefik to detect the file, create the temporary _acme-challenge TXT record via Cloudflare, and save the wildcard certificate.

Step 4.5: Verify Wildcard Certificate Issuance

bash — server
# 1. Confirm your domain and wildcard SAN are stored in acme.json
sudo grep -E '"main"|"sans"' /data/coolify/proxy/acme.json

# 2. Verify Traefik presents the Let's Encrypt wildcard cert over TLS
openssl s_client \
  -servername coolify.yourdomain.com \
  -connect 127.0.0.1:443 </dev/null 2>/dev/null \
  | openssl x509 -noout -subject -issuer -dates -ext subjectAltName

If it has not issued yet, inspect Traefik logs with docker logs coolify-proxy --tail 100.

Step 4.6: Cut Over Coolify's Domain & Disable Tailscale Serve

  1. In Coolify → Settings → General:
    • Set URL (Instance's Domain) to https://coolify.yourdomain.com.
    • Enable Redirect HTTP to HTTPS.
    • Set your Timezone to America/New_York.
    • Click Save.
  2. In Coolify → Servers → localhost → General:
    • Set Wildcard Domain to https://yourdomain.com and click Save.
  3. Open https://coolify.yourdomain.com in a new browser tab and confirm the valid Let's Encrypt padlock and dashboard load cleanly.
  4. Disable the temporary tailscale serve listener so Traefik owns port 443 exclusively:
bash — server
sudo tailscale serve --https=8443 off
tailscale serve status
Phase 4 Verification
Phase 5

Configure Off-Server Backups with Cloudflare R2

Step 5.1: Create the Cloudflare R2 Bucket

  1. In Cloudflare Dashboard, navigate to R2 Object Storage (activate R2 if this is your first time).
  2. Click Create bucket and configure:
    • Bucket Name: private-cloud-backup
    • Location: Automatic
    • Default Storage Class: Standard
  3. Open the bucket's Settings tab, confirm Public Access is Disabled, and copy the S3 API endpoint URL:
text — Cloudflare R2 S3 API Endpoint
https://YOUR_CLOUDFLARE_ACCOUNT_ID.r2.cloudflarestorage.com

Step 5.2: Generate a Bucket-Scoped R2 API Token (coolify-r2-backup)

  1. In Cloudflare Dashboard → R2 Object Storage, click Manage R2 API Tokens → Create API Token.
  2. Configure:
    • Token Name: coolify-r2-backup
    • Permissions: Object Read & Write
    • Specify bucket(s): Apply to specific bucket only → private-cloud-backup
    • TTL: Forever
  3. Click Create API Token, copy the Access Key ID and Secret Access Key immediately, and save both in your password manager.

Step 5.3: Connect Cloudflare R2 in Coolify

  1. In Coolify, go to Storages → + Add (select S3).
  2. Enter the storage settings:
    Field Value
    Name Cloudflare R2
    Endpoint / Host https://YOUR_CLOUDFLARE_ACCOUNT_ID.r2.cloudflarestorage.com (if Host-only without https://, omit the scheme)
    Bucket private-cloud-backup
    Region auto
    Access Key / Secret Key Your coolify-r2-backup keys
    Use path-style URLs Checked (true)
    Skip TLS certificate verification Unchecked (false)
  3. Click Validate Connection & Continue.

Step 5.4: Schedule Backups & Cap Retention

  1. In Coolify, navigate to Settings → Backup.
  2. Click Enable S3 and select Cloudflare R2.
  3. Configure schedule and free-tier retention caps:
    • Backup Frequency: Daily (0 0 * * * UTC)
    • Local backups to keep: 7
    • S3 backups to keep: 30
    • S3 Maximum storage (GB): 8 (stays safely inside R2's 10 GB/month free tier)
  4. Click Save changes, then click Back Up Now.

Step 5.5: Save Coolify's Encryption Key (APP_KEY) Off-Server

Mandatory for Disaster Recovery

Coolify encrypts its database backups and stored credentials with APP_KEY. Without the original APP_KEY stored off-server in your password manager, encrypted .dmp archives in Cloudflare R2 cannot be decrypted on a replacement server.

bash — server
sudo grep '^APP_KEY=' /data/coolify/source/.env

Copy the entire APP_KEY=base64:... line into your password manager.

Phase 5 Verification
Phase 6

Configure Out-of-Band Email Alerting

Step 6.1: Onboard an Isolated Alert Subdomain (alerts.yourdomain.com)

Isolating server alerts on alerts.yourdomain.com ensures Cloudflare Email Service never adds MX or SPF records to your root yourdomain.com domain, leaving it completely clean for regular email hosting.

  1. In Cloudflare Dashboard, navigate to Compute → Email Service → Email Sending (or Email → Email Service).
  2. Add the sending domain alerts.yourdomain.com.
  3. Approve the automated DNS records Cloudflare generates for alerts.yourdomain.com (SPF, DKIM, and return-path records).

Step 6.2: Verify Your Destination Email Address

On Cloudflare's Free tier, Email Sending delivers exclusively to verified destination addresses:

  1. Under Email Service → Destination addresses, click Add destination address.
  2. Enter you@example.com and click the verification link sent to your inbox.

Step 6.3: Create an Account-Scoped API Token (coolify-smtp-alerts)

Critical Scope Detail — Must Be Account-Scoped

Cloudflare Email Service SMTP authentication requires an Account-scoped API token. A Zone/Domain-scoped token will fail SMTP authentication.

  1. In Cloudflare Dashboard → Manage Account → Account API Tokens → Create Token → Create Custom Token.
  2. Configure:
    • Token Name: coolify-smtp-alerts
    • Permissions: Switch the policy scope dropdown from Specified Domains / Zone to Account, then select Email Sending → Edit.
    • Account Resources: Include → Your Cloudflare Account.
  3. Click Continue to summary → Create Token, copy the token, and save it in your password manager as CF_SMTP_API_TOKEN.

Step 6.4: Configure Coolify SMTP & Alert Triggers

  1. In Coolify, go to Settings → Email, select SMTP, and enter:
    Field Value Notes
    Host smtp.mx.cloudflare.net Cloudflare Email Service SMTP relay
    Port 465 Implicit TLS port
    Encryption TLS / SSL Required — Cloudflare does not support STARTTLS on port 587
    Username api_token Literal string api_token
    Password YOUR_CF_SMTP_API_TOKEN Your Account-scoped coolify-smtp-alerts token
    From Name Coolify Display name
    From Address coolify@alerts.yourdomain.com Matches your onboarded sending subdomain
  2. Click Save, then click Send Test (send to you@example.com).
  3. Navigate to Notifications → Email:
    • Set Email service to Use system-wide settings.
    • Confirm your Coolify admin profile email matches your verified destination address (you@example.com).
    • Enable failure and health triggers: Deployment failure, Backup failure, Restart limit reached, Server disk usage, and Server unreachable (plus optionally Image vulnerabilities, Scheduled task failure, Docker cleanup failure, Server patching, and Traefik status).
    • Click Save, then click Send Test.
Phase 6 Verification
Phase 7

Deploying Your First App & Operational Guardrails

Standard 4-Step App Deployment Workflow

Repeat this workflow for every self-hosted application you deploy:

  1. Verify linux/arm64 Support: Confirm the container image publishes a native ARM64 manifest before deploying:
    bash — server or local terminal
    docker manifest inspect <registry/image:tag> | grep -E '"architecture"|"os"'
  2. Deploy in a Coolify Project: Open Coolify → Projects, create or select a project, click + New Resource, and deploy your Docker image, service template, or Docker Compose stack.
  3. Assign Your Subdomain: In the resource's Domains tab, set the URL to:
    text — Coolify Domains field
    https://<app>.yourdomain.com
    Save and deploy. No new Cloudflare DNS records are needed—Traefik automatically routes the subdomain and attaches your wildcard certificate.
  4. Back Up Application Databases to R2: Coolify's instance backup covers Coolify itself, not your application databases. Whenever an app creates its own PostgreSQL, MySQL, or MariaDB container, open that database's Backups tab in Coolify, schedule a daily backup, and point it to Cloudflare R2.

Interactive Free-Tier Headroom & Starter App Calculator

Projected Cloud Cost: $0.00/month
OCI Compute (Ampere A1) 2 / 2 OCPUs
1,488 / 1,500 Always Free OCPU-hrs/mo
OCI Memory Headroom 3.42 / 12.00 GB
8.58 GB free headroom (includes 2.0 GB OS + Coolify baseline)
OCI Boot Storage (10 VPU) 100 / 200 GB
100 GB Always Free block headroom remaining
Cloudflare R2 Backups 8 / 10 GB Cap
Hard 8 GB Coolify retention cap inside 10 GB free tier
0 MB (0.00 GB)

Starter Self-Hosted App Ideas

All four apps below publish native linux/arm64 images and fit comfortably inside your 12 GB RAM budget:

App Suggested Subdomain What It Does Typical Steady RAM
Vaultwarden https://vault.yourdomain.com Lightweight Bitwarden-compatible password manager ~50–100 MB
Paperless-ngx https://docs.yourdomain.com Document scanner, OCR, and searchable PDF archive ~600 MB–1.2 GB
Stirling-PDF https://pdf.yourdomain.com Private local PDF toolbox (merge, split, redact, OCR) ~300–500 MB
Actual Budget https://budget.yourdomain.com Local-first envelope budgeting and personal finance ~80–150 MB

Four Hard Guardrails to Stay at $0.00/Month

  1. Compute Limit: Never exceed 2 OCPUs / 12 GB RAM on OCI VM.Standard.A1.Flex (stays within 1,500 OCPU hours and 9,000 GB hours per month).
  2. Storage & VPU Limit: Never exceed 200 GB total boot + block storage across your OCI tenancy, and keep every volume strictly at 10 VPU (Balanced).
  3. R2 Backup Cap: Keep Cloudflare R2 retention caps at 8 GB or below so total bucket usage never crosses Cloudflare R2's 10 GB/month free tier.
  4. Zero Public Ingress: Never add inbound rules back to your OCI VCN Security List—keep all administrative and application access routed exclusively through Tailscale.
Final Readiness Checklist