Skip to content

Self hosting on Dokploy

FilipNone edited this page Dec 1, 2026 · 4 revisions

Oshi Engine runs as one container with its data in a named volume. This page sets it up on Dokploy. Any host with Docker Compose works the same way; only the domain step differs.

You need a Dokploy server and an OpenAI-compatible model server the engine can reach: Ollama, llama.cpp, vLLM, LM Studio, or a hosted API such as OpenRouter. The model server is not part of the stack.

1. Create the service

In your Dokploy project, add a Compose service:

  • Provider: GitHub or Git, repository https://github.com/oshiengine/oshi-engine, branch main.
  • Compose path: pick one.
Compose path What you get
./docker-compose.yml the engine with web chat (with its themes, stickers and photo and voice messages), novel mode and the settings UI
./docker-compose-lite.yml the engine only, managed with the CLI or the API
./docker-compose-full.yml every first-party module, plus SearXNG and a headless Chrome so she can search the web

The template in dokploy/oshi-engine/ sets up the same thing with the domain already in place. To use it, open the service's Advanced tab, choose Import, and paste the base64 of docker-compose.yml and template.toml from that folder.

2. Environment

Open the Environment tab and paste .env.example. Most lines are commented out because the settings UI can do the same later. Set at least these:

OSHI_PUBLIC_URL=https://oshi.example.com
OSHI_CHARACTER__TIMEZONE=Europe/Rome

OSHI_LLM__PROVIDERS__LOCAL__BASE_URL=http://ollama:11434/v1
OSHI_LLM__CHAT__MODEL=qwen3:14b
OSHI_LLM__EMBEDDING__MODEL=nomic-embed-text

With a hosted API, add its key:

OSHI_LLM__PROVIDERS__LOCAL__BASE_URL=https://openrouter.ai/api/v1
OSHI_LLM__PROVIDERS__LOCAL__API_KEY=sk-or-...
OSHI_LLM__CHAT__MODEL=mistralai/mistral-small-3.2-24b-instruct

For the full stack, also set SEARXNG_SECRET to a random string (openssl rand -hex 32).

A value set here wins over the settings UI and shows there with a lock. Leave out anything you want to change from the UI.

Module settings work the same way, as OSHI_MODULE_<ID>__<KEY>. For Telegram: OSHI_MODULE_TELEGRAM__BOT_TOKEN=123456:ABC....

Who can create an account in the web chat is OSHI_AUTH__SIGNUP: invite (default, with a code from the Access view), open or off.

3. Domain

In the Domains tab, add your domain to the oshi-engine service, port 7420, with HTTPS on. Chat is at /, novel mode at /novel, settings at /settings.

To give a part its own domain, add that domain to the same service and port, then set the matching variable: OSHI_CHAT_URL, OSHI_NOVEL_URL or OSHI_SETTINGS_URL.

4. Deploy and sign in

Deploy, then open the Logs tab. On the first start the engine prints a setup code:

WARN No login exists yet. Open the settings UI and enter this setup code to create the owner login: K7QM-4XPA

Open https://<your domain>/settings, enter the code, and choose the owner's username and password. The code works once and is printed on every start until the first login exists.

In the settings UI, check Models: each provider gets a green light when the engine can reach it. Then write her personality under Character.

Updates

The engine updates itself inside the volume. Modules update on their own by default (OSHI_MODULES__AUTO_UPDATE). The core waits for you unless you turn on OSHI_UPDATES__AUTO; the Updates view in the settings UI shows what is available and which modules a core update would leave behind.

Redeploying with a newer image also updates the core. Both ways take a backup first and roll back if the new version does not start. Backups are in the volume under /data/backups.

Until 0.9.0 the service was called engine. If your Domains tab still lists engine, change each domain to oshi-engine before you deploy again; Dokploy stops the deploy when a domain names a service the compose file does not have. The data volume stays the same.

OSHI_IMAGE_TAG picks the image: stable (default), beta, or a version such as 0.8.2.

The image package on GitHub's registry may still be private while the project is young; if docker pull is denied, build it from a checkout with docker/build-local.sh.

Backups and the CLI

Everything lives in the oshi-data volume, so Dokploy's volume backups cover it.

The CLI is in the container and already has an owner key:

docker compose exec oshi-engine oshi status
docker compose exec oshi-engine oshi module list
docker compose exec oshi-engine oshi login add alice --level admin

In Dokploy, the service's terminal runs the same commands.

Without Dokploy

Copy a compose file and .env.example (as .env) to a directory, fill in .env, and run docker compose up -d. The compose files only expose port 7420 for a reverse proxy. To reach the engine from the same machine, add this to the oshi-engine service:

    ports:
      - "127.0.0.1:7420:7420"

Clone this wiki locally