Hello.
I’m trying to install Vikunja as service on Ubuntu Server.
I thought that Vikunja don’t need HOME folder if it has WorkingDirectory, and created dedicated user with this command:
useradd --system --shell /usr/sbin/nologin --no-create-home vikunja
But after first launch I got error:
failed to create modcache index dir: mkdir /home/vikunja: permission denied
I started from over and make user with this:
useradd --system --shell /usr/sbin/nologin --home /home/vikunja --create-home vikunja
After that I created other folders:
mkdir /var/lib/vikunja
chown vikunja:vikunja /var/lib/vikunja
chmod 755 /var/lib/vikunja
mkdir /etc/vikunja
Copied executable and configuration file:
cp vikunja-v2.1.0-linux-amd64 /usr/local/bin/vikunja
cp config.yml.sample /etc/vikunja/config.yml
I configuration file was changed only two lines:
# service:service:
# publicurl: ""publicurl: "http://10.0.2.15"
And make service unit file:
[Unit]
Description=Vikunja
[Service]
Type=simple
User=vikunja
Group=vikunja
WorkingDirectory=/var/lib/vikunja
ExecStart=/usr/local/bin/vikunja
Restart=on-failure
Service can’t start, and give me failure:
Could not init file handler: storage validation failed: failed to create file storage directory at /usr/local/bin/files: mkdir /usr/local/bin/files: permission denied
I’ve modified service unit file to get output of doctor command:
StandardOutput=append:/tmp/vikunja.log
This is Vikunja doctor report:
Vikunja Doctor
==============
System
✓ Version: v2.1.0
✓ Go: go1.26.0
✓ OS: linux/amd64
✓ User: vikunja (uid=998)
✓ Working directory: /var/lib/vikunja
✓ User namespace: not active
Configuration
✓ Config file: /etc/vikunja/config.yml
✓ Public URL: http://10.0.2.15/
✓ JWT secret: configured (auto-generated)
✓ CORS origins: http://127.0.0.1:*
http://localhost:*
http://10.0.2.15
Database (sqlite)
✗ Connection: could not open database file [uid=998, gid=997]: open /usr/local/bin/vikunja.db: permission denied
Files (local)
✗ Initialization: storage validation failed: failed to create file storage directory at /usr/local/bin/files: mkdir /usr/local/bin/files: permission denied
[process uid=998 gid=997]
2 check(s) failed
Report show that Vikunja see right path of working directory but why is trying to create storage directory and database file in binary folder?
P.S. When I set service.rootpath in /etc/vikunja/config.yml as /var/lib/vikunja
Vikunja create files folder in that path but still trying to make database on /usr/local/bin/vikunja.db
Supports page here Configuration options tells:
If
service.rootpathis explicitly configured (differs from the binary location), the database path is resolved relative to that directory