🔧 AI Nachrichten ChatGPT showing blank screen [Fix](05.09.2026 um 19:55 Uhr)
🔧 AI Nachrichten Erstellen Sie mit Google Gemini Music eigene Songs per KI(07.09.2026 um 08:00 Uhr)
🕵️ Sicherheitslücken0patch liefert drei Jahre Support für Microsoft Office 2021 - BornCity(07.09.2026 um 00:15 Uhr)
🔧 AI Nachrichten ChatGPT showing blank screen [Fix](05.09.2026 um 19:55 Uhr)
🔧 AI Nachrichten Erstellen Sie mit Google Gemini Music eigene Songs per KI(07.09.2026 um 08:00 Uhr)
🕵️ Sicherheitslücken0patch liefert drei Jahre Support für Microsoft Office 2021 - BornCity(07.09.2026 um 00:15 Uhr)

🔧 Programmierung 🕛 kürzlich 3 Min Lesezeit
0

Deploying LocalAI Self-Hosted AI Model Management Platform on Ubuntu 24.04

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

LocalAI is an open-source platform for running Large Language Models locally with an OpenAI-compatible API, so you can swap it in behind existing OpenAI client code without paying per-token or sending data off-server. This guide deploys LocalAI using Docker Compose with Traefik handling automatic HTTPS, persistent model and cache directories, and a working chat-completion test. By the end, you'll have LocalAI serving an OpenAI-compatible API securely at your domain.









Set Up the Directory Structure



1. Create the project directories:




CODE
$ mkdir -p ~/localai/{models,cache}
$ cd ~/localai






models/ holds downloaded model files; cache/ persists between restarts.



2. Create the environment file:




CODE
$ nano .env









CODE
DOMAIN=localai.example.com
LETSENCRYPT_EMAIL=[email protected]












Deploy with Docker Compose



1. Add your user to the Docker group:




CODE
$ sudo usermod -aG docker $USER
$ newgrp docker






2. Create the Compose manifest:




CODE
$ nano docker-compose.yaml









CODE
services:
traefik:
image: traefik:v3.6
container_name: traefik
restart: unless-stopped
environment:
DOCKER_API_VERSION: "1.44"
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- "--certificatesresolvers.le.acme.httpchallenge=true"
- "--certificatesresolvers.le.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.le.acme.email=${LETSENCRYPT_EMAIL}"
- "--certificatesresolvers.le.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./letsencrypt:/letsencrypt

localai:
image: localai/localai:latest-aio-cpu
container_name: localai
restart: unless-stopped
volumes:
- ./models:/models:cached
- ./cache:/cache:cached
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/readyz"]
interval: 1m
timeout: 20s
retries: 5
labels:
- "traefik.enable=true"
- "traefik.http.routers.localai.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.localai.entrypoints=websecure"
- "traefik.http.routers.localai.tls=true"
- "traefik.http.routers.localai.tls.certresolver=le"
- "traefik.http.services.localai.loadbalancer.server.port=8080"






Swap localai/localai:latest-aio-cpu for a GPU variant (latest-aio-gpu-nvidia-cuda-12) if the host has an NVIDIA GPU.



3. Set the models directory permissions and start the stack:




CODE
$ sudo chmod -R 755 ~/localai/models
$ docker compose up -d
$ docker compose ps












Verify the API



1. Check readiness:




CODE
$ curl -i https://localai.example.com/readyz






A 200 OK confirms Traefik is routing to LocalAI.



2. List the available models:




CODE
$ curl https://localai.example.com/v1/models






3. Run a chat completion:




CODE
$ curl -X POST https://localai.example.com/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4",
"messages": [
{"role": "user", "content": "Explain what LocalAI does in one sentence."}
],
"max_tokens": 60
}'






LocalAI returns a response in the OpenAI completion shape.









Access the Dashboard



Open https://localai.example.com in a browser to browse the model gallery, install new models, and run inference from the UI.









Next Steps



LocalAI is running and served securely over HTTPS. From here you can:




  • Install additional models from the gallery for domain-specific tasks

  • Point any OpenAI SDK at the LocalAI base URL by changing OPENAI_API_BASE

  • Run a GPU variant for image generation, embeddings, and faster LLM inference



For the full guide with additional tips, visit the original article on Vultr Docs.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 36%
🟡 In Evaluierung 28%
🟢 Keine Auswirkung 16%
Spannende Innovation 20%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
2 Quellen
[webapps] C-MOR 6.0104 - Cross-Site Scripting (XSS)
2 Quellen
[webapps] CubeCart 6.7.4 - Stored XSS
1 Quelle
[remote] CVE-2026-42167 - ProFTPD mod_sql post-authentication SQLi - RCE
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Deploying LocalAI Self-Hosted AI Model Management Platform on Ubuntu 24.04

Thematisch verwandte Begriffe: Deploying, LocalAI, SelfHosted, Model · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...