Self-Hosting with Docker

Hosting your own Hollama instance with Docker gives you full control over your application and ensures maximum privacy.

Prerequisites

  • Docker must be installed on your system.

Getting Started

To start a Hollama server, run the following command in your terminal:

docker run --rm -d -p 4173:4173 --name hollama ghcr.io/fmaclen/hollama:latest

This command does the following:

  • --rm: Automatically removes the container when it exits.
  • -d: Runs the container in detached mode (in the background).
  • -p 4173:4173: Maps port 4173 on your host to port 4173 in the container.
  • --name hollama: Assigns a convenient name to the container.
  • ghcr.io/fmaclen/hollama:latest: Specifies the Docker image to use.

Once the container is running, you can access your Hollama instance at http://localhost:4173.

Updating to the Latest Version

To update your Hollama instance to the latest version, follow these steps:

  1. Stop the current container:

    docker stop hollama

  2. Pull the latest image:

    docker pull ghcr.io/fmaclen/hollama:latest

  3. Start the container again with the original run command:

    docker run --rm -d -p 4173:4173 --name hollama ghcr.io/fmaclen/hollama:latest

Configuration

Allowed Hosts

When hosting Hollama behind a reverse proxy or in an environment where the hostname is not localhost, you must specify which domains are allowed to access the application. Use the VITE_ALLOWED_HOSTS environment variable for this.

docker run --rm -d -p 4173:4173 \
  -e VITE_ALLOWED_HOSTS='your-domain.com,another-domain.com' \
  --name hollama ghcr.io/fmaclen/hollama:latest
  • Multiple domains can be provided as a comma-separated list.
  • If this variable is not set, access is restricted to localhost.

Connecting to a Remote Ollama Server

If your Ollama server is running on a different machine than your Hollama Docker container, you must configure Ollama to allow cross-origin requests from Hollama's URL.

Set the OLLAMA_ORIGINS environment variable when starting your Ollama server.

# Example: Allow connections from your custom domain
OLLAMA_ORIGINS=https://hollama.your-domain.com ollama serve

For more details, refer to the official Ollama documentation on remote access.