# Self-Hosted Setup — Utan Sudo > Datum: 2026-06-26 > Status: API körs, nginx kräver sudo --- ## ✅ API Kör Nu (Direkt) ```bash # API körs på port 8000 med SSL curl -k https://localhost:8000/health ``` **Resultat:** ```json { "status": "healthy", "version": "1.0.0", "components": { "goid": "ok", "taxonomy": "ok", "defects": "ok", "risk": "ok", "ledger": "ok", "auth": "ok", "visual_geolocation": "ok" } } ``` --- ## 🔧 Nginx Setup (Kräver Sudo) För att köra nginx som reverse proxy: ```bash # 1. Kopiera config (kräver sudo) sudo cp /home/bernt/.openclaw/workspace/iom/nginx/selfhosted.conf /etc/nginx/sites-available/iom-api # 2. Aktivera site (kräver sudo) sudo ln -sf /etc/nginx/sites-available/iom-api /etc/nginx/sites-enabled/ # 3. Testa config (kräver sudo) sudo nginx -t # 4. Starta om nginx (kräver sudo) sudo systemctl restart nginx ``` --- ## 🌐 DNS Setup (Self-Hosted) ### Alternativ 1: AWS Route 53 (Rekommenderat) ```bash # Installera AWS CLI pip install awscli # Konfigurera aws configure # Skapa DNS records aws route53 change-resource-record-sets \ --hosted-zone-id YOUR_ZONE_ID \ --change-batch '{ "Changes": [ { "Action": "CREATE", "ResourceRecordSet": { "Name": "api.quixzoom.com", "Type": "A", "TTL": 300, "ResourceRecords": [{"Value": "YOUR_SERVER_IP"}] } }, { "Action": "CREATE", "ResourceRecordSet": { "Name": "api.landvex.com", "Type": "A", "TTL": 300, "ResourceRecords": [{"Value": "YOUR_SERVER_IP"}] } } ] }' ``` ### Alternativ 2: /etc/hosts (Lokal test) ```bash # Lägg till i /etc/hosts (kräver sudo) echo "127.0.0.1 api.quixzoom.com api.landvex.com" | sudo tee -a /etc/hosts ``` ### Alternativ 3: Let's Encrypt (Production SSL) ```bash # Installera certbot sudo apt-get install certbot # Generera certifikat sudo certbot certonly --standalone \ -d api.quixzoom.com \ -d api.landvex.com # Uppdatera nginx config med nya certifikat ``` --- ## 🚀 Produktionsdeployment ### Steg 1: DNS 1. Logga in på AWS Route 53 2. Skapa A-records för api.quixzoom.com och api.landvex.com 3. Peka till serverns publika IP ### Steg 2: SSL (Let's Encrypt) ```bash sudo certbot --nginx \ -d api.quixzoom.com \ -d api.landvex.com ``` ### Steg 3: Nginx ```bash sudo systemctl restart nginx ``` ### Steg 4: Testa ```bash curl https://api.quixzoom.com/health curl https://api.landvex.com/health ``` --- ## ✅ Status | Komponent | Status | Action | |-----------|--------|--------| | **API** | ✅ Kör | Ingen action | | **SSL** | ✅ Self-signed | Byt till Let's Encrypt | | **Nginx** | ⚠️ Kräver sudo | Kör script med sudo | | **DNS** | ⚠️ Kräver Route 53 | Konfigurera A-records | --- ## 🎯 Nästa Steg 1. **Kör nginx setup med sudo:** ```bash sudo /home/bernt/.openclaw/workspace/iom/scripts/setup_selfhosted.sh ``` 2. **Konfigurera DNS i Route 53** 3. **Generera Let's Encrypt certifikat** 4. **Testa endpoints** --- *Dokumentation av Bernt (AI-assistent)* *Datum: 2026-06-26*