DEV Community

kusunoki
kusunoki

Posted on

I Built My Own Private Cloud + 4 AI Assistants on One Server (No SaaS, Full Control)

Self-Hosted AI Infrastructure for Small Businesses — Part 3 of 5

Free series. All open-source. No DevOps background required. Estimated hands-on time: 60–90 minutes.

You now have a server no one can see.

In this part, you turn it into something people actually use.

What You Will Complete in This Part

By the end of this part:

Your private cloud is live (cloud.yourdomain.com)
Documents open and sync in real time
Four AI models run behind a single interface
An AI agent executes tasks autonomously
Backups run automatically
Your entire system is usable from any browser
Before You Start: One Rule About AI

Before sending a single request:

👉 Set a hard monthly spending cap on every provider

AI APIs do not stop automatically.

Step 1: Install Docker
sudo apt install -y docker.io docker-compose
sudo systemctl enable --now docker
sudo usermod -aG docker myadmin

Logout and login again.

Verify:

docker --version
docker ps
Step 2: Deploy Your Private Cloud (Nextcloud)

Create environment:

mkdir -p ~/nextcloud && cd ~/nextcloud
nano docker-compose.yml

Paste:

version: '3'
services:

db:
image: postgres:15
restart: always
environment:
- POSTGRES_DB=nextcloud_db
- POSTGRES_USER=nextcloud_user
- POSTGRES_PASSWORD=YOUR_PASSWORD
volumes:
- nextcloud_db_data:/var/lib/postgresql/data

app:
image: nextcloud:latest
restart: always
depends_on:
- db
ports:
- "127.0.0.1:8080:80"
environment:
- POSTGRES_HOST=db
- POSTGRES_DB=nextcloud_db
- POSTGRES_USER=nextcloud_user
- POSTGRES_PASSWORD=YOUR_PASSWORD
volumes:
- nextcloud_data:/var/www/html

collabora:
image: collabora/code
restart: always
environment:
- aliasgroup1=https://cloud.yourdomain.com:443
ports:
- "127.0.0.1:9980:9980"

volumes:
nextcloud_db_data:
nextcloud_data:

Run:

docker-compose up -d

Open:

👉 https://cloud.yourdomain.com

Your private cloud is now live.

Step 3: Real-Time Documents (Collabora)
Install “Nextcloud Office”
Connect:

👉 https://office.yourdomain.com

Test:

Open a document
Edit from another device

👉 Changes sync instantly

Step 4: Your 4-AI Interface

Create environment:

mkdir -p ~/llm-proxy && cd ~/llm-proxy
python3 -m venv venv
source venv/bin/activate
pip install fastapi uvicorn httpx python-dotenv

Add keys:

nano .env
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
GOOGLE_API_KEY=...
PERPLEXITY_API_KEY=...

Verify:

curl http://localhost:8000/health

👉 One interface
👉 Four models

Step 5: AI Agent (OpenClaw)
npm install -g openclaw
openclaw onboard --install-daemon

Test:

openclaw status

👉 “Gateway: running”

Step 6: Calendar Sync
iPhone / Android / PC
CalDAV

👉 Same calendar everywhere

Step 7: Custom Email

Create:

👉 yourname@yourdomain.com

Add:

DKIM
SPF
DMARC

👉 Professional + secure

Step 8: Automatic Backup

Create script:

nano ~/backup.sh

Schedule:

crontab -e

👉 Daily backup runs automatically

What You Just Built
Component Status
Private cloud ✓
Real-time docs ✓
AI system ✓
AI agent ✓
Backup ✓

👉 This is no longer infrastructure
👉 This is a working system

Why This Changes Everything

Instead of:

SaaS subscriptions
Fragmented tools
External data storage

You now have:

One system
Full control
Predictable cost
What Part 4 Adds
Remote desktop (browser-based)
Monitoring (Prometheus + Grafana)

👉 Production-ready infrastructure

Final Thought

Most people never build systems like this.

Not because it’s difficult —
but because they never see it done step by step.

Part 4 is next.

— Kusunoki

Top comments (0)