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.
Architecture Overview & Cost Breakdown
By the end of this guide, you will have a production-grade personal cloud with five core properties:
- 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. - Private Encrypted Mesh Access: You access your server's shell and web applications exclusively over Tailscale (WireGuard) from your laptop, desktop, or phone.
- Self-Hosted PaaS with Automated Wildcard HTTPS: Coolify manages your Docker apps and databases while Traefik serves every app at
https://<app>.yourdomain.comusing a single, auto-renewing Let's Encrypt wildcard certificate obtained via the Cloudflare DNS-01 challenge—no public port80or443required. - Automated Off-Server Backups: Coolify runs daily encrypted backups both locally and off-site to Cloudflare R2 (S3-compatible object storage), capped at
8 GBto stay inside R2's free tier. - Out-of-Band Email Alerting: Server health, disk usage, and backup failure alerts are sent through Cloudflare Email Service on an isolated
alerts.yourdomain.comsubdomain so your mainyourdomain.comdomain remains untouched for regular email hosting.
Interactive Architecture & Traffic Flow
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 |
Prerequisites & Free Accounts Checklist
Have all five items ready before starting Phase 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). -
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.00billed while under 10 GB), and Email Service. - 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).
-
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.Flexcompute 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.
- Always Free Ampere A1 Allowance: OCI provides 1,500 OCPU hours and 9,000 GB hours per month of
-
A Password Manager: Needed to store generated Cloudflare API tokens and Coolify's database backup encryption key (
APP_KEY) off-server.
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:
- In the OCI Console, open Networking → Virtual Cloud Networks.
- Click Start VCN Wizard → Create VCN with Internet Connectivity → Start VCN Wizard.
- 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
- Navigate to Compute → Instances → Create Instance.
- 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
- Number of OCPUs:
- 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.keyto~/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).
- Name:
- Click Create and wait ~2 minutes for the instance state to reach Running.
- Copy the instance's Public IP address (
YOUR_SERVER_PUBLIC_IP) from the Instance Details page.
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:
# 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:
sudo apt update && sudo apt upgrade -y
Verification
Run the following commands on the server to confirm ARM64 architecture, memory, and disk allocation:
uname -m
free -h
df -h /
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:
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
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
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.
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:
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:
- In the OCI Console, open Compute → Instances →
my-private-cloud. - Click the linked Subnet under Primary VNIC (for example,
Public Subnet-...). - Click the attached Security List (for example,
Default Security List for ...). - Under Ingress Rules, select all rules (including TCP port
22) and click Remove. Zero ingress rules should remain. - Leave Egress Rules untouched (
0.0.0.0/0All 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:
# 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"
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):
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:
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
- Open
https://<hostname>.<tailnet>.ts.net:8443in your browser (with Tailscale active). - Immediately register your Root Team administrator account using your verified email (
[email protected]) and a strong password saved in your password manager. - Complete the onboarding wizard by selecting Localhost as your managed server.
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 |
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)
- In Cloudflare Dashboard, click your profile icon → My Profile → API Tokens → Create Token.
- Click Get started next to Create Custom Token and configure:
- Token Name:
coolify-traefik-dns - Permissions:
Zone → Zone → ReadandZone → DNS → Edit - Zone Resources:
Include → Specific zone → yourdomain.com
- Token Name:
- 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
- In Coolify, go to Servers →
localhost→ Proxy → Configuration (docker-compose.yml). - Inside the
traefikservicecommand:list, add these DNS-01 flags (and remove any conflictinghttpchallengeflags if present):
- '--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'
- Under the
traefikservice, add (or update) theenvironment:block with your token:
environment:
- CF_DNS_API_TOKEN=YOUR_CF_DNS_API_TOKEN
- 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.
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
# 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
- In Coolify → Settings → General:
- Set URL (
Instance's Domain) tohttps://coolify.yourdomain.com. - Enable Redirect HTTP to HTTPS.
- Set your Timezone to
America/New_York. - Click Save.
- Set URL (
- In Coolify → Servers →
localhost→ General:- Set Wildcard Domain to
https://yourdomain.comand click Save.
- Set Wildcard Domain to
- Open
https://coolify.yourdomain.comin a new browser tab and confirm the valid Let's Encrypt padlock and dashboard load cleanly. - Disable the temporary
tailscale servelistener so Traefik owns port443exclusively:
sudo tailscale serve --https=8443 off
tailscale serve status
Configure Off-Server Backups with Cloudflare R2
Step 5.1: Create the Cloudflare R2 Bucket
- In Cloudflare Dashboard, navigate to R2 Object Storage (activate R2 if this is your first time).
- Click Create bucket and configure:
- Bucket Name:
private-cloud-backup - Location:
Automatic - Default Storage Class:
Standard
- Bucket Name:
- Open the bucket's Settings tab, confirm Public Access is Disabled, and copy the S3 API endpoint URL:
https://YOUR_CLOUDFLARE_ACCOUNT_ID.r2.cloudflarestorage.com
Step 5.2: Generate a Bucket-Scoped R2 API Token (coolify-r2-backup)
- In Cloudflare Dashboard → R2 Object Storage, click Manage R2 API Tokens → Create API Token.
- Configure:
- Token Name:
coolify-r2-backup - Permissions:
Object Read & Write - Specify bucket(s): Apply to specific bucket only →
private-cloud-backup - TTL:
Forever
- Token Name:
- 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
- In Coolify, go to Storages → + Add (select S3).
- Enter the storage settings:
Field Value Name Cloudflare R2Endpoint / Host https://YOUR_CLOUDFLARE_ACCOUNT_ID.r2.cloudflarestorage.com(if Host-only withouthttps://, omit the scheme)Bucket private-cloud-backupRegion autoAccess Key / Secret Key Your coolify-r2-backupkeysUse path-style URLs Checked ( true)Skip TLS certificate verification Unchecked ( false) - Click Validate Connection & Continue.
Step 5.4: Schedule Backups & Cap Retention
- In Coolify, navigate to Settings → Backup.
- Click Enable S3 and select
Cloudflare R2. - 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)
- Backup Frequency: Daily (
- Click Save changes, then click Back Up Now.
Step 5.5: Save Coolify's Encryption Key (APP_KEY) Off-Server
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.
sudo grep '^APP_KEY=' /data/coolify/source/.env
Copy the entire APP_KEY=base64:... line into your password manager.
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.
- In Cloudflare Dashboard, navigate to Compute → Email Service → Email Sending (or Email → Email Service).
- Add the sending domain
alerts.yourdomain.com. - 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:
- Under Email Service → Destination addresses, click Add destination address.
- Enter
[email protected]and click the verification link sent to your inbox.
Step 6.3: Create an Account-Scoped API Token (coolify-smtp-alerts)
Cloudflare Email Service SMTP authentication requires an Account-scoped API token. A Zone/Domain-scoped token will fail SMTP authentication.
- In Cloudflare Dashboard → Manage Account → Account API Tokens → Create Token → Create Custom Token.
- 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.
- Token Name:
- 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
- In Coolify, go to Settings → Email, select SMTP, and enter:
Field Value Notes Host smtp.mx.cloudflare.netCloudflare Email Service SMTP relay Port 465Implicit TLS port Encryption TLS / SSLRequired — Cloudflare does not support STARTTLS on port 587Username api_tokenLiteral string api_tokenPassword YOUR_CF_SMTP_API_TOKENYour Account-scoped coolify-smtp-alertstokenFrom Name CoolifyDisplay name From Address coolify@alerts.yourdomain.comMatches your onboarded sending subdomain - Click Save, then click Send Test (send to
[email protected]). - Navigate to Notifications → Email:
- Set Email service to Use system-wide settings.
- Confirm your Coolify admin profile email matches your verified destination address (
[email protected]). - Enable failure and health triggers:
Deployment failure,Backup failure,Restart limit reached,Server disk usage, andServer unreachable(plus optionallyImage vulnerabilities,Scheduled task failure,Docker cleanup failure,Server patching, andTraefik status). - Click Save, then click Send Test.
Deploying Your First App & Operational Guardrails
Standard 4-Step App Deployment Workflow
Repeat this workflow for every self-hosted application you deploy:
-
Verify
linux/arm64Support: Confirm the container image publishes a native ARM64 manifest before deploying:bash — server or local terminaldocker manifest inspect <registry/image:tag> | grep -E '"architecture"|"os"' - 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.
-
Assign Your Subdomain: In the resource's Domains tab, set the URL to:
Save and deploy. No new Cloudflare DNS records are needed—Traefik automatically routes the subdomain and attaches your wildcard certificate.text — Coolify Domains field
https://<app>.yourdomain.com - 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/monthStarter 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
- 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). - Storage & VPU Limit: Never exceed 200 GB total boot + block storage across your OCI tenancy, and keep every volume strictly at 10 VPU (Balanced).
- 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.
- Zero Public Ingress: Never add inbound rules back to your OCI VCN Security List—keep all administrative and application access routed exclusively through Tailscale.