2.4 KiB
2.4 KiB
Netcup Quick Setup Guide
1. Server vorbereiten
Netcup VPS bestellen
- Mindestens: VPS 200 G8 (2 CPU, 4GB RAM)
- OS: Ubuntu 22.04 LTS
- Netzwerk: IPv4 + IPv6
SSH-Key installieren
# SSH-Key generieren (falls noch nicht vorhanden)
ssh-keygen -t ed25519 -C "netcup-deploy"
# Key zum Server kopieren
ssh-copy-id root@DEINE-SERVER-IP
2. Konfiguration
Basis-Einstellungen
# Server-Details eintragen
vim inventory/hosts.yml
Wichtig ändern:
ansible_host: 85.123.456.789→ deine Netcup IPdomain: "example.com"→ deine Domainssl_email: "admin@example.com"→ deine E-Mailgit_repo: "https://github.com/user/repo.git"→ dein Git Repository
DNS konfigurieren
Stelle sicher dass deine Domain zur Netcup IP zeigt:
# A-Record setzen
example.com. IN A DEINE-NETCUP-IP
3. App-Anforderungen
Deine App braucht:
- Dockerfile im Repository-Root
- Port 3000 (oder ändere
app_portin hosts.yml) - Health-Check Endpoint
/health(oder änderehealth_check_url)
Beispiel Dockerfile (Node.js)
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["npm", "start"]
Beispiel Health-Check (Express.js)
app.get('/health', (req, res) => {
res.json({ status: 'ok', timestamp: new Date().toISOString() });
});
4. Deployment
# Einfach deployen
make deploy
# Oder manuell
./deploy.sh
5. Troubleshooting
Server nicht erreichbar?
# Ping testen
ping DEINE-SERVER-IP
# SSH testen
ssh root@DEINE-SERVER-IP
# Firewall prüfen (auf dem Server)
ufw status
SSL-Probleme?
# DNS prüfen
nslookup DEINE-DOMAIN
# Certbot manuell
ssh root@DEINE-SERVER-IP
certbot certificates
App startet nicht?
# Logs anschauen
make logs
# Container status
ansible all -m shell -a "docker ps -a"
# Ins Container einsteigen
ansible all -m shell -a "docker exec -it CONTAINER_NAME sh"
6. Nach dem Deployment
- ✅ App testen: https://deine-domain.com
- ✅ Health-Check: https://deine-domain.com/health
- ✅ SSL prüfen: https://www.ssllabs.com/ssltest/
- ✅ Performance: https://pagespeed.web.dev/
7. Updates
# App updaten (git pull + rebuild)
make update
# Logs nach Update prüfen
make logs
Das war's! Deine App läuft jetzt auf Netcup mit SSL! 🎉