# How to start Vikunja API in Docker with sqlite?

**URL:** <https://community.vikunja.io/t/how-to-start-vikunja-api-in-docker-with-sqlite/43>\
**Category:** Bug\
**Created:** [22 June 2020 08:12 UTC](https://community.vikunja.io/t/how-to-start-vikunja-api-in-docker-with-sqlite/43 "2020-06-22T08:12:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjorsg](https://community.vikunja.io/letter_avatar_proxy/v4/letter/s/a8b319/32.png) [@sjorsg](https://community.vikunja.io/u/sjorsg)\
**Post date:** [22 June 2020 08:12 UTC](https://community.vikunja.io/t/how-to-start-vikunja-api-in-docker-with-sqlite/43/1 "2020-06-22T08:12:30Z")

</div>

I’ve started a Docker container, with a volume mounted at /storage. I then start Vikunja with the following environment variables:

```auto
VIKUNJA_DATABASE_TYPE: sqlite
VIKUNJA_DATABASE_PATH: /storage/vikunja.db

```

However, Vikunja API fails to start:

```auto
usermod: no changes
2020/06/22 07:53:59 Config File "config" Not Found in "[/app/vikunja /etc/vikunja /app/vikunja/.config/vikunja]"
2020/06/22 07:53:59 Using default config.
2020-06-22T07:53:59.935817756Z: CRITICAL	▶ migration/Migrate 002 Migration failed: unable to open database file: no such file or directory

```

I’ve checked that /storage exists by replacing the command with `ls -la /storage`:

```auto
total 24
drwxr-xr-x 3 root root 4096 Jun 21 17:19 .
drwxr-xr-x 1 root root 4096 Jun 22 07:57 ..
drwx------ 2 root root 16384 Jun 21 17:19 lost+found

```

Why isn’t the vikunja.db created when the API starts?

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [23 June 2020 08:00 UTC](https://community.vikunja.io/t/how-to-start-vikunja-api-in-docker-with-sqlite/43/2 "2020-06-23T08:00:12Z")

</div>

Vikunja is not running as root in docker, therefore the api process has no rights to write in the `/storage` directory. You should modify the folder so the vikunja run user has the right to access it. Take a look at [the docs](https://vikunja.io/docs/install-backend/#setting-user-and-group-id-of-the-user-running-vikunja) for more info. Since you’re mounting `/storage` as a volume would need to do this at the host running the container.

I’ll put up a fix to improve the error message.

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [23 June 2020 11:11 UTC](https://community.vikunja.io/t/how-to-start-vikunja-api-in-docker-with-sqlite/43/3 "2020-06-23T11:11:35Z")

</div>

Better error message is implemented as of [caee123f9](https://kolaente.dev/vikunja/api/commit/caee123f9d2c297a7b8cd92115a0ed609761f198).

---

<div class="post-metadata">

**Author:** ![sjorsg](https://community.vikunja.io/letter_avatar_proxy/v4/letter/s/a8b319/32.png) [@sjorsg](https://community.vikunja.io/u/sjorsg)\
**Post date:** [28 June 2020 16:23 UTC](https://community.vikunja.io/t/how-to-start-vikunja-api-in-docker-with-sqlite/43/4 "2020-06-28T16:23:26Z")

</div>

Thanks for your response! I’ve set PUID and PGID to 1000 and have ensured the host volume is chowned to 1000:1000. Now, the API server indeed seems to start correctly. Thanks!

---

<div class="post-metadata">

**Author:** ![kolaente](https://community.vikunja.io/user_avatar/community.vikunja.io/kolaente/32/5_2.png) [@kolaente](https://community.vikunja.io/u/kolaente)\
**Post date:** [1 July 2020 16:09 UTC](https://community.vikunja.io/t/how-to-start-vikunja-api-in-docker-with-sqlite/43/5 "2020-07-01T16:09:11Z")

</div>

Glad it works for you now!
