NAS
Photo of author

Self-Hosting Local AI (Ollama) on Your NAS for Private Tagging

Self-hosting Ollama on a NAS means running a local large language model inference server entirely on your own hardware, with no data sent to external APIs, no subscription costs, and no rate limits imposed by a third-party provider.

Running a self-hosted LLM on a NAS sits at the intersection of two things we care deeply about at datahoarder.io: keeping your data private and preserving full control over your digital infrastructure. If you have years of personal documents, photo archives, research notes, or project files sitting on a NAS, the ability to query, tag, summarize, and search that content using a local LLM is genuinely useful.

The appeal of self-hosting open-source LLMs on a NAS is straightforward: your prompts never leave your network, your archival data stays local, and you are not dependent on cloud availability or pricing changes.

Ollama makes this accessible. It wraps model management, an OpenAI-compatible API, and a straightforward CLI into a single tool that runs cleanly inside Docker, which most modern NAS devices already support. The tradeoff is real: a NAS is not a GPU server, and CPU-only inference is slow compared to a dedicated rig with an RTX 3090 or Apple Silicon like the M2. That means model selection matters a lot.

This guide walks through what to realistically expect, how to size hardware and pick models, how to deploy Ollama and Open WebUI with Docker on a Synology NAS, and how to keep the whole setup private and well-maintained.

What To Expect From A NAS-Based Local LLM

A NAS-based local LLM setup is not a replacement for a dedicated GPU inference server, but it fills a specific niche well. For personal archival search, document summarization, automated tagging pipelines, and lightweight chat, a properly configured NAS running Ollama can handle real workloads without sending a single byte to Claude or GPT-4o.

Where Ollama Fits In A Homelab Stack

Ollama acts as the model runtime and exposes an OpenAI-compatible API on localhost:11434. That API compatibility is what makes it useful inside a homelab: tools like n8n, retrieval pipelines, and vector database integrations can point directly at the Ollama API the same way they would point at a cloud endpoint.

Alternatives like vLLM and LocalAI exist, but Ollama is the easiest entry point. It handles model downloads, quantization selection, and server management with minimal configuration. For a NAS deployment, that simplicity is important because you are already working within hardware constraints.

When A NAS Is Good Enough And When It Is Not

A NAS is a reasonable fit when the workload is asynchronous and latency-tolerant. Summarizing a batch of archived documents overnight, running embeddings for a RAG pipeline against a personal knowledge base, or tagging a photo collection are all workloads where slow tokens-per-second is acceptable.

A NAS is not a good fit for real-time conversational use with large models. A 13B model on a CPU-only NAS may produce output at two to four tokens per second. That is usable for batch jobs. It is frustrating for interactive chat.

Common Uses For Private Archive Search And Automation

The most practical NAS-based Ollama use cases we have seen are:

  • Document summarization: Automatically summarize PDFs, notes, and scanned text files stored on the NAS
  • Private semantic search: Generate embeddings for a local document corpus and query against a vector database without any cloud API calls
  • RAG pipelines: Connect Ollama to a retrieval pipeline via n8n or a custom script to answer questions against archival data
  • Automated file tagging: Use a vision-capable or text model to generate metadata tags for large digital asset collections
  • Chat over local documents: Ask questions about your own data using Open WebUI connected to the local Ollama API

Hardware Limits, RAM Sizing, And Model Selection

The honest reality of running Ollama on a NAS is that the hardware ceiling arrives quickly. CPU inference speed, total RAM, and the absence of a discrete GPU all shape which models are usable and what response times look like in practice.

Synology NAS Compatibility And CPU Constraints

Synology NAS devices vary widely in CPU architecture. Ollama requires a 64-bit x86 processor; ARM-based NAS units are not compatible with the standard Ollama Docker image. Most current Synology units in the DS or RS line use Intel Celeron, Pentium, or Core-based processors, which are supported but slow for inference.

CPU-only inference means every token is computed on the main processor. A Celeron J4125, for example, produces usable output with a 3B model but struggles with a 7B model at a speed that is practical for interactive use. Knowing your NAS CPU before pulling a model saves a lot of frustration.

RAM, VRAM, Quantization, And Context Window Basics

On a NAS, there is no VRAM. Everything runs in system RAM. The model must fit entirely in RAM or it will not run. A useful rule of thumb:

Model SizeMinimum RAM (Q4 Quantization)Comfortable RAM
3B4 GB6 GB
7B / 8B8 GB12 GB
13B16 GB20 GB
30B24 GB32 GB
70B48 GB64 GB

Quantization reduces model size by lowering the precision of weights. A Q4 quantized 7B model takes roughly half the RAM of a full-precision version and runs noticeably faster on CPU. The quality tradeoff is minor for most summarization and tagging tasks.

Context window also consumes RAM. Larger context lengths increase memory usage at inference time, even if the model itself fits comfortably.

Choosing Between 3B, 7B, 13B, And Larger Models

For most NAS deployments with 8 GB to 16 GB of RAM, the practical choices are:

  • gemma3:1b or llama3.2:3b: Fit in 4 to 6 GB of RAM. Fast on CPU. Best for simple tagging, extraction, and short-context summarization.
  • Llama 3.1 8B or Mistral 7B (Q4): Require 8 to 10 GB of RAM. Noticeably better reasoning and output quality. Usable on a NAS with 16 GB RAM.
  • Gemma 2 or 13B models (Q4): Require 16 to 20 GB RAM. Slow on NAS hardware but capable for batch jobs where speed is not critical.
  • Llama 3 or other 13B models: Same range; fine for overnight archive processing pipelines.
  • 30B or 70B models: Not practical for CPU-only NAS inference. A dedicated GPU server with an RTX 3090 or better is the appropriate platform.

For most home archivist use cases, Llama 3.1 8B or Mistral 7B at Q4 quantization offers the best balance of quality and usability on a mid-range Synology NAS with 16 GB RAM.

Self Hosting Ollama NAS Setup With Docker

Getting Ollama running on a Synology NAS is a Docker operation from start to finish. The setup involves three stages: installing a container management interface, deploying the Ollama container with proper storage mounts, and pulling a model to confirm everything works.

Installing Container Manager Or Portainer

Synology DSM includes Container Manager as a first-party package. Open the Package Center, search for “Container Manager,” and install it. Container Manager supports both a GUI-based deployment workflow and direct Docker Compose file imports, which is the approach we recommend for reproducibility.

If you prefer Portainer for a more feature-rich container management interface, it can be deployed as a container itself. Pull the portainer/portainer-ce image and run it with a Docker socket mount. For most Synology users, Container Manager is sufficient and avoids an extra dependency.

Deploying The Ollama Container With Persistent Storage

Create a folder on your NAS volume to store Ollama models and data. A path like /volume1/docker/ollama works well. This folder becomes the persistent volume mount so models survive container restarts.

A minimal docker-compose.yml for CPU-only Ollama on a Synology NAS:

version: "3.8"
services:
  ollama:
    image: ollama/ollama:latest
    container_name: ollama
    restart: unless-stopped
    ports:
      - "11434:11434"
    volumes:
      - /volume1/docker/ollama:/root/.ollama
    environment:
      - OLLAMA_HOST=0.0.0.0

Setting OLLAMA_HOST=0.0.0.0 allows other containers on the same Docker network to reach the API. Without this, the API binds only to the container’s internal loopback.

Import this file into Container Manager under “Create Project” and deploy. The container should start and the API will be accessible at http://[NAS-IP]:11434.

Pulling And Testing Your First Model

Once the container is running, connect to it via SSH or use the Container Manager terminal. Run:

docker exec ollama ollama pull llama3.2:3b

This pulls the 3B model into the persistent storage volume. After the download completes, test the model with:

docker exec ollama ollama run llama3.2:3b "Summarize what a NAS is in two sentences."

A response confirms the runtime is working. On a CPU-only NAS, expect the first token to appear after several seconds. That delay is normal for cold inference on CPU hardware.

Adding Open WebUI And Connecting Other Tools

Open WebUI gives Ollama a browser-based chat interface, model switcher, and persistent conversation history. It connects to the Ollama API container over the internal Docker network and adds a layer of usability that makes day-to-day interaction with local models practical.

Open WebUI Configuration And Persistent App Data

Add Open WebUI to your Docker Compose project alongside Ollama. Create a persistent data directory at /volume1/docker/open-webui to store conversations, settings, and uploaded files.

  open-webui:
    image: ghcr.io/open-webui/open-webui:latest
    container_name: open-webui
    restart: unless-stopped
    ports:
      - "3000:8080"
    volumes:
      - /volume1/docker/open-webui:/app/backend/data
    environment:
      - OLLAMA_BASE_URL=http://ollama:11434
      - WEBUI_SECRET_KEY=changethis
    depends_on:
      - ollama

Set WEBUI_SECRET_KEY to a unique string before deploying. This key signs session tokens for the web interface. Leaving it at the default weakens session security.

Using OLLAMA_BASE_URL Across Containers

The OLLAMA_BASE_URL=http://ollama:11434 value works because both containers are on the same Docker Compose network. Docker resolves the ollama hostname to the Ollama container’s internal IP automatically.

If you are running Open WebUI as a separate container not defined in the same Compose file, use http://host.docker.internal:11434 instead. This routes to the host machine’s network stack rather than relying on Docker service discovery.

Connecting Automation And Retrieval Workflows

The Ollama API is OpenAI-compatible, which means any tool that accepts an OpenAI-style endpoint can point at http://ollama:11434 or http://[NAS-IP]:11434 from within the local network. For n8n automation workflows, set the OpenAI base URL to the local Ollama address and use any running model name as the model identifier.

For RAG pipelines, generate embeddings by calling the Ollama API with an embedding-capable model like nomic-embed-text. Store those embeddings in a vector database running on the same NAS or a separate container. This gives you fully private semantic search over personal document archives with no external API calls.

Privacy, Network Access, And Safe Exposure

The privacy benefit of a local Ollama deployment only holds if the API stays private. An unprotected Ollama instance exposed to the public internet is a real risk, both for data leakage and for abuse of compute resources.

LAN-Only Access Vs Remote Exposure

The default Ollama configuration, when OLLAMA_HOST is set to 0.0.0.0, makes the API reachable from any device on the local network via port 11434. For most home NAS setups, LAN-only access is the correct choice. Nothing in the Ollama API requires internet exposure for local use.

If remote access is needed, do not expose port 11434 directly. Use a VPN to reach the home network first, then connect to the local API. This keeps the Ollama API invisible to the public internet entirely.

Reverse Proxy, HTTPS, And Synology Firewall Basics

If a browser-accessible interface like Open WebUI needs HTTPS or a friendly domain name, place it behind a reverse proxy. Caddy is a lightweight option that handles automatic TLS certificate management and proxies traffic to the Open WebUI container port.

The Synology firewall can restrict port 11434 to LAN subnets only. In DSM, go to Control Panel, Firewall, and add a rule that blocks external traffic to port 11434 while allowing traffic from the local subnet. This provides a hardware-level backstop even if Docker’s networking is misconfigured.

Data Handling, Logging, And Responsible Use

Ollama does not log prompt content by default. Conversations entered through Open WebUI are stored in the /app/backend/data volume on the NAS, which means they persist locally and are not transmitted anywhere. Personal archival data processed through the API stays on the NAS.

Keep the Ollama container updated regularly. The project moves quickly, and older versions have had issues with unauthenticated API exposure when bound to external interfaces. Monitoring container logs via docker compose logs ollama for unexpected errors is a straightforward maintenance habit worth building.

Performance Tuning, Maintenance, And Troubleshooting

After the basic setup is running, a handful of environment variables and maintenance habits make a meaningful difference in responsiveness and stability.

Concurrency, Keep-Alive, And Loaded Model Settings

Ollama exposes several environment variables that control runtime behavior:

  • OLLAMA_KEEP_ALIVE: Controls how long a model stays loaded in RAM after the last request. The default is 5 minutes. Setting it to 0 unloads the model immediately after each request, freeing RAM. Setting it to -1 keeps the model loaded permanently, which speeds up repeated requests on a NAS with sufficient RAM.
  • OLLAMA_NUM_PARALLEL: Sets the number of parallel requests Ollama will process. On a NAS with a weak CPU, leaving this at 1 avoids resource contention that slows all requests.
  • OLLAMA_MAX_LOADED_MODELS: Limits how many models can be loaded in RAM simultaneously. On a NAS with 16 GB RAM running a 7B model, setting this to 1 prevents accidental memory pressure if multiple models are pulled.

Add these to the environment block in your docker-compose.yml and redeploy.

Updating Containers And Managing The Model Library

Update the Ollama container by pulling the latest image and recreating the container:

docker compose pull
docker compose up -d

The model library stored in the persistent volume is unaffected by container updates. To list downloaded models, run:

docker exec ollama ollama list

To remove a model that is no longer needed and reclaim disk space:

docker exec ollama ollama rm modelname

Ollama is released under the MIT License, and documentation for all supported models is available on the official Ollama model library page.

Fixing Slow Responses And Connection Errors

Slow responses on a NAS are almost always a hardware constraint rather than a configuration problem. If tokens per second are lower than expected, check that the model fits entirely in RAM with headroom left for the OS. Swap usage during inference will slow generation dramatically.

For connection errors where Open WebUI cannot reach Ollama, verify that both containers are on the same Docker network. Check that the OLLAMA_BASE_URL value in the Open WebUI container matches the Ollama container’s service name. If connecting from outside the Compose stack, use http://host.docker.internal:11434 instead of http://ollama:11434.

If the Ollama container fails to start with an entrypoint or shell script error, check that the image architecture matches your NAS CPU. The standard ollama/ollama:latest image targets x86-64; running it on an ARM-based NAS will fail at startup.

Explore Get Newshosting for private, high-speed access to Usenet archives to feed your data hoarding setup alongside your local AI stack.

Frequently Asked Questions

How do I install and run Ollama on a Synology NAS?

Install Container Manager from the Synology Package Center, then deploy Ollama using a Docker Compose file with a persistent volume mount for model storage and OLLAMA_HOST=0.0.0.0 set in the environment. After the container starts, use docker exec ollama ollama pull [modelname] to download a model and docker exec ollama ollama run [modelname] to test it.

What hardware specs and OS requirements are needed to run local LLMs on a NAS?

Ollama requires a 64-bit x86 processor, so ARM-based NAS units are not supported with the standard image. A minimum of 8 GB RAM is recommended for running a 7B model at Q4 quantization; 16 GB provides comfortable headroom. DSM 7 with Container Manager or a compatible Docker runtime is the software requirement.

Should I deploy Ollama using Docker on a NAS, and how should the container be configured?

Docker is the correct deployment method for a Synology NAS since Ollama does not have a native DSM package. Configure the container with a host volume mount for model persistence, expose port 11434 for LAN access, and set OLLAMA_HOST=0.0.0.0 so other containers on the same network can reach the API.

How can I enable GPU acceleration (or understand the limitations) when running LLMs on a NAS?

Most Synology NAS devices do not have a discrete GPU and cannot pass a GPU through to the Ollama container. Inference runs entirely on the CPU, which is slower than a dedicated GPU server. If GPU acceleration matters for your workload, a separate machine with an RTX 3090 or Apple Silicon like an M2 is a better platform for Ollama than a NAS.

Which open-source or local models perform best for typical home NAS use cases like chat and summarization?

For NAS hardware with 16 GB RAM, Llama 3.1 8B and Mistral 7B at Q4 quantization offer the best balance of output quality and speed. For lower-RAM systems, llama3.2:3b or gemma3:1b are faster alternatives suited to summarization and tagging tasks. Coding models like CodeLlama are usable but slow on CPU-only hardware.

How do I troubleshoot common startup issues like entrypoint or shell script errors when launching the service?

Entrypoint errors at container startup usually mean the image architecture does not match the NAS CPU, which happens when pulling a GPU-specific image tag on a CPU-only x86 NAS. Confirm you are using ollama/ollama:latest rather than a CUDA-specific tag. Also verify that the persistent volume path exists on the NAS before deploying, since Ollama will fail silently if the mount point is missing.

About the Author

Don is a tech enthusiast with a passion for datahoarding, privacy, and security. He has been involved in technology for over a decade, working in various roles such as a desktop support engineer, network administrator, and IT consultant. Don's extensive experience in the tech industry has given him a deep understanding of how technology works and how to use it to its fullest potential.

Don is particularly interested in topics such as VPNs, privacy and IRC, which are all related to data privacy and security. He believes that protecting our digital privacy is essential, especially in today's world where data breaches and cyber attacks are becoming more common. Don has dedicated himself to educating himself and others on how to protect their digital privacy and stay safe online.

In addition to his tech expertise, Don is also an avid gamer. He enjoys playing video games in his free time, and is also a family man who enjoys spending time with his wife and children. He believes that technology should enhance our lives and bring us closer together, and he strives to promote this message through his work.