{
  "id": 6590273,
  "title": "Self-hosting AnythingLLM: the three settings that decide whether your workspaces survive a redeploy",
  "url": "https://urgent.news/2026/09/10/self-hosting-anythingllm-the-three-settings-that-decide-whether-your",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-10T13:20:16.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/greatsage_sh/self-hosting-anythingllm-the-three-settings-that-decide-whether-your-workspaces-survive-a-redeploy-3kik"
  },
  "original_language": "en",
  "account": "Self-hosting AnythingLLM is a straightforward process, but it comes with three crucial settings that must be correctly configured or risk losing your workspaces. The first setting is STORAGE_DIR, which is where all your data is stored: uploaded documents, the vector cache, the LanceDB vector store, workspace and user records in SQLite. This directory must be mounted as a volume for the container to function correctly. If the volume is not mounted, the container will still start, but once you redeploy, all your workspaces, embeddings, and users will be lost. The failure is not due to anything wrong with AnythingLLM but rather due to the unmounted path. The second setting is that the process needs to own the STORAGE_DIR directory. The image writes to this directory during boot-up, creating SQLite migrations, LanceDB on-disk tables, and the documents cache. If the volume is mounted into the container as a non-root user, the process will fail on write with permissions errors. On Docker, you can run as root or chown the mount to the app’s UID before the first boot. On Railway, this is handled automatically by setting RAILWAY_RUN_UID=0, as Railway runs containers as a non-root user by default. The third setting is that AnythingLLM does not read an injected $PORT variable. It listens on port 3001 and stays there. Platforms that provide a port via $PORT, such as Railway, Heroku, or Cloud Run, will route to the wrong place, resulting in a 502 error at the edge. To fix this, you must pin the port by setting PORT=3001 so that the platform’s proxy targets the correct port the app is running on. Additionally, set the healthcheck to / to avoid any potential confusion caused by a deeper route. These three settings are essential for ensuring that your AnythingLLM workspaces survive a redeploy. If you prefer not to configure these settings yourself, a Railway template is available that sets them all up correctly. Remember that the same three settings apply, regardless of the platform you are using.",
  "summary": "Self-hosting AnythingLLM is one docker run away, and then a redeploy quietly eats every workspace you made. That is not a bug in AnythingLLM — it is three settings the image expects you to get right, and none of them are the ones you would guess. I maintain a one-click Railway template for it, so I have hit all three. Here they are for anyone running it on Docker, Compose, Fly, Render, Coolify or…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}