Skip to content

How-ToGPU

How to Auto-Tag Bookmarks in Linkwarden With a Local AI Model via Ollama

Linkwarden, the free self-hosted bookmark archiver, can tag every page you save with AI. We show how to install it with Docker, connect it to a small model in Ollama, pick a tagging method and write custom prompts that work.

By , Systems & Technical Editor

5 min read

How to Auto-Tag Bookmarks in Linkwarden With a Local AI Model via Ollama

Linkwarden is a free, self-hosted bookmark manager that saves a copy of every page you bookmark, so links don't vanish when a site goes offline. It also has an optional AI tagging feature that reads each saved page and suggests tags. You can point it at Ollama, so your browsing history is tagged by a small model on your own PC rather than a cloud service.

It is based on Linkwarden's README and its Setup, AI Tagging and Environment Variables documentation, plus the Ollama FAQ, all read on 2 December 2026. The newest Linkwarden release on GitHub at the time of writing was v2.17.0, published on 10 November 2026.

What Linkwarden does

According to its README, Linkwarden can:

  • Capture a screenshot, a PDF and a single HTML file of each page you save.

  • Show a reader view where you can highlight and annotate text.

  • Optionally send pages to the Wayback Machine for a snapshot.

  • Organise links by collection, sub-collection and multiple tags, and share collections with other people with per-member permissions.

  • Search by full text, subscribe to RSS feeds and sync with browser bookmarks via Floccus.

  • Tag links automatically with local AI (optional).

It also has official iOS and Android apps and a browser extension. Linkwarden is open source under the AGPL-3.0 licence, and there is a paid hosted version if you don't want to run it yourself.

What you need

Linkwarden's Setup page says it "runs comfortably on a small VPS or home server", and lists:

  • Memory: 4GB as a comfortable starting point.

  • CPU: any two-core machine. Images are published for x86-64 and ARM64.

  • Disk: about 1.5GB for the image, plus your data.

Those figures are for Linkwarden itself. The AI model needs memory on top of that, though Linkwarden's AI Tagging page says "a lightweight model like the phi3:mini-4k is enough". You'll also need Docker, plus Ollama with a model downloaded. If you're new to Ollama, start with our guide to installing Ollama on Linux; on Windows, use the installer from ollama.com.

Step 1: Install Linkwarden with Docker Compose

These are the Docker steps from Linkwarden's Setup page.

  1. Create a folder and download the compose file and sample settings:

mkdir linkwarden && cd linkwarden
curl -O https://raw.githubusercontent.com/linkwarden/linkwarden/refs/heads/main/docker-compose.yml
curl -L https://raw.githubusercontent.com/linkwarden/linkwarden/refs/heads/main/.env.sample -o ".env"
  1. Open .env and set the required values:

NEXTAUTH_URL=http://localhost:3000/api/v1/auth
NEXTAUTH_SECRET=VERY_SENSITIVE_SECRET
MEILI_MASTER_KEY=VERY_SENSITIVE_MEILI_MASTER_KEY
POSTGRES_PASSWORD=CUSTOM_POSTGRES_PASSWORD

You must change NEXTAUTH_SECRET, POSTGRES_PASSWORD and MEILI_MASTER_KEY, and each one should be a different secret phrase. If a phrase contains special characters, wrap it in single or double quotes.

Step 2: Add the Ollama settings

Pull a small model in Ollama first, for example ollama pull phi3:mini-4k, the model suggested in Linkwarden's docs. Then add two lines to .env:

NEXT_PUBLIC_OLLAMA_ENDPOINT_URL=http://localhost:11434
OLLAMA_MODEL=phi3:mini-4k

That is the example from Linkwarden's AI Tagging page. There is a catch when Linkwarden runs in Docker and Ollama runs directly on your PC. Inside a container, localhost refers to the container itself. Karakeep's documentation makes the same point about its Docker set-up. If tagging doesn't work, use your PC's local network address instead, for example http://192.168.1.50:11434.

The Ollama FAQ says Ollama only listens on 127.0.0.1 by default. Set the OLLAMA_HOST environment variable (for example 0.0.0.0:11434) to make it reachable from other addresses, then restart Ollama. Only do this on a network you trust. Our guide to sharing Ollama on your local network covers this in more detail.

Using LM Studio or another server instead: Linkwarden also accepts any OpenAI-compatible provider through CUSTOM_OPENAI_BASE_URL, OPENAI_MODEL and OPENAI_API_KEY. Leave out the base URL and those settings go to OpenAI's own cloud API, which is not what you want for private tagging.

Step 3: Start Linkwarden and create the admin account

In the folder that holds .env, run docker compose up. The Setup page says that after a few minutes, depending on your internet connection, you can open Linkwarden at http://localhost:3000.

Create your account straight away. The first account on a new instance becomes the administrator, so do this before you make the instance reachable from anywhere else.

Step 4: Choose a tagging method

Linkwarden's docs describe three AI tagging methods:

  • Auto Generate Tags: the model invents tags from the page content.

  • Based on Predefined Tags: the model can only choose from a list of tags you set up.

  • Based on Existing Tags: the model chooses from your 50 most-used tags.

If you already have a tagging system, the predefined or existing methods keep things tidy, because the docs say tags that aren't in the given list are dropped. Auto Generate is the easiest way to start from nothing, but expect to merge a few near-duplicate tags over time.

Step 5: Customise the prompts (optional)

Each method has a built-in prompt, and you can replace it with your own through an environment variable: AI_GENERATE_TAGS_PROMPT, AI_PREDEFINED_TAGS_PROMPT or AI_EXISTING_TAGS_PROMPT. Two placeholders are available:

  • {{text}} is replaced with the content of the page. If you leave it out, the content is added to the end of your prompt.

  • {{tags}} is replaced with the comma-separated list of tags the model must choose from, for the predefined and existing methods.

The important rule is that your prompt must still ask for a JSON array of tag names, such as ["Tag1", "Tag2"], because that is how Linkwarden reads the answer. The docs say a reply it can't parse is discarded and the link stays untagged. That matters with small local models, so keep the instruction short and explicit. For example, you could ask for three to five tags in British English and nothing but the JSON array.

Two formatting tips from the docs: wrap a prompt in single quotes if it contains double quotes, because a double quote can't be escaped inside a double-quoted value. If the prompt has no double quotes, you can use double quotes and write line breaks as \n.

Changing a prompt only affects links tagged from then on. Links that already have tags aren't processed again.

Why use a local model for this?

A bookmark library is a detailed record of what you read, research and buy. With Ollama on your own PC, the page text Linkwarden sends for tagging stays on your hardware. The trade-off is that you supply the compute and accept whatever quality a small model gives. Linkwarden only needs short tag lists, so it suits small models better than most AI features do.

Want AI summaries and semantic search as well as tags? See our guide to using Karakeep with Ollama, or compare the two apps in Karakeep vs Linkwarden.

The bottom line

Linkwarden's AI tagging is easy to run locally. Add NEXT_PUBLIC_OLLAMA_ENDPOINT_URL and OLLAMA_MODEL to .env, use an Ollama address the Docker container can actually reach, and start with a small model like phi3:mini-4k, which Linkwarden's docs say is enough. Choose the Predefined or Existing Tags method to stop your tag list sprawling, and if you write a custom prompt, make sure it still asks for a JSON array.

Sources

  1. 01Linkwarden README (GitHub, linkwarden/linkwarden)
  2. 02Linkwarden docs, Self Hosting Setup
  3. 03Linkwarden docs, AI Tagging
  4. 04Linkwarden docs, Environment Variables
  5. 05Linkwarden releases (GitHub)
  6. 06Karakeep docs, Configuring different AI providers
  7. 07Ollama FAQ

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

How to Use Karakeep With Ollama for Private AI Bookmark Tagging

How-To

How to Use Karakeep With Ollama for Private AI Bookmark Tagging

Karakeep, the self-hosted bookmark app formerly called Hoarder, can tag and summarise everything you save with AI. We show how to install it with Docker, connect it to Ollama on your own PC and tune its settings for a local model.

Marcus Thorne6 min