General Question about the Installation

Hi There,

i would like to install Vikunja Backend on a Windows Server, whats the best way to do this?

:slight_smile:

If you only need the api, you should be able to just download the api binary from here and then just run it. That will use sqlite by default which should be fine if you don’t plan on having a lot of users.

I don’t know anything about how to run it in the background though, I don’t have that much experience with windows so you’ll have to figure that out yourself (sorry). This may be helpful.

If you have docker on that machine you might also use one of the docker-compose examples.

Thanks for the quick reply :slightly_smiling_face:
I will try to install the docker Version

1 Like

Hi, its me again. Im trying to get vikunja running in docker.
I managed to run both the frontend and api in docker containers, but it seems to me like the database is missing. I can reach the frontend but the registration button is missing. The api is also reachable under the port :3456

Im a newbie to this topic and im kinda lost now. Any tips on how to continue would be much appreciated.

That sounds like you didn’t configure the api url in the frontend container.

Could you share the config you’ve used? I guess you’re using docker-compose?

Right now im not using the compose yet, i will get to that soon.

I am studying the docker commands right now, but even though i know how to set the environment variable, i dont how the syntax.

i am guessing it must be something like this:

docker run -e $VIKUNJA_API_URL=192.168.5.6:3456 vikunja/frontend

But since its not working, i must be missing something out. ( Im new to linux also :upside_down_face: )

That should be docker run -e VIKUNJA_API_URL=192.168.5.6:3456/api/v1/ vikunja/frontend. Environnement variables are always set without the $ at the beginning in docker.

Definitely try docker-compose though. It will make your live much easier. This may be helpful for you: Docker Walkthrough | Vikunja

hi, thanks for the quick reply.

The command was accepted and i do find the path under"env" via the inspect command, but i still dont get the register button. Could you give me another hint on what to do next please?

I will definitely try compose after i got this running. Im using it as a learning opportunity.

edit: so i managed to get it working by editing the api path on the frontend via the change button. But why didnt it work through the environment variable? :thinking:

What was the exact output of the docker inspect env section? What do you get if you run the env command from another terminal in the running container (something like docker exec <container id> env)?

hi, thanks for the reply.

I just continued this project and ran into a problem:

i installed docker-compose and created the docker-compose.yml & nginx.conf, but if i run docker-compose up i run into permission issues even though i am do it as the root user. It seems like docker-compose is not

can you help me out? if you need more information, please let me know

Information:

Creating network “docker_compose_default” with the default driver
Creating docker_compose_db_1 … done
Creating docker_compose_frontend_1 … done
Creating docker_compose_api_1 … done
Creating docker_compose_proxy_1 … done
Attaching to docker_compose_db_1, docker_compose_frontend_1, docker_compose_api_1, docker_compose_proxy_1
api_1 | usermod: no changes
api_1 | 2021/04/12 14:48:12 Config File “config” Not Found in “[/app/vikunja /etc/vikunja /app/vikunja/.config/vikunja]”
api_1 | 2021/04/12 14:48:12 Using default config.
api_1 | 2021-04-12T14:48:12.185986797Z: CRITICAL :arrow_forward: migration/Migrate 002 Migration failed: dial tcp 172.18.0.2:3306: connect: connection refused
db_1 | 2021-04-12 14:48:10+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.9+maria~focal started.
db_1 | find: ‘/var/lib/mysql/’: Permission denied
db_1 | chown: changing ownership of ‘/var/lib/mysql/’: Permission denied
proxy_1 | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
proxy_1 | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
proxy_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
proxy_1 | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
proxy_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
proxy_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
proxy_1 | /docker-entrypoint.sh: Configuration complete; ready for start up
proxy_1 | 2021/04/12 14:48:13 [emerg] 1#1: open() “/etc/nginx/conf.d/default.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:31
proxy_1 | nginx: [emerg] open() “/etc/nginx/conf.d/default.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:31
docker_compose_db_1 exited with code 1
proxy_1 | /docker-entrypoint.sh: Configuration complete; ready for start up
proxy_1 | 2021/04/12 14:48:14 [emerg] 1#1: open() “/etc/nginx/conf.d/default.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:31
proxy_1 | nginx: [emerg] open() “/etc/nginx/conf.d/default.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:31
docker_compose_proxy_1 exited with code 1
db_1 | find: ‘/var/lib/mysql/’: Permission denied
db_1 | chown: changing ownership of ‘/var/lib/mysql/’: Permission denied
docker_compose_api_1 exited with code 1
docker_compose_proxy_1 exited with code 1
proxy_1 | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
proxy_1 | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
proxy_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
proxy_1 | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
proxy_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
proxy_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
proxy_1 | /docker-entrypoint.sh: Configuration complete; ready for start up
proxy_1 | 2021/04/12 14:48:13 [emerg] 1#1: open() “/etc/nginx/conf.d/default.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:31
proxy_1 | nginx: [emerg] open() “/etc/nginx/conf.d/default.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:31
proxy_1 | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
proxy_1 | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
proxy_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
proxy_1 | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
proxy_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
proxy_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
proxy_1 | /docker-entrypoint.sh: Configuration complete; ready for start up
proxy_1 | 2021/04/12 14:48:14 [emerg] 1#1: open() “/etc/nginx/conf.d/default.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:31
proxy_1 | nginx: [emerg] open() “/etc/nginx/conf.d/default.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:31
proxy_1 | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
proxy_1 | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
proxy_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
proxy_1 | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
proxy_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
proxy_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
proxy_1 | /docker-entrypoint.sh: Configuration complete; ready for start up
proxy_1 | 2021/04/12 14:48:15 [emerg] 1#1: open() “/etc/nginx/conf.d/default.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:31
proxy_1 | nginx: [emerg] open() “/etc/nginx/conf.d/default.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:31
api_1 | 2021/04/12 14:48:17 Config File “config” Not Found in “[/app/vikunja /etc/vikunja /app/vikunja/.config/vikunja]”
api_1 | 2021/04/12 14:48:17 Using default config.
proxy_1 | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
proxy_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
proxy_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
proxy_1 | /docker-entrypoint.sh: Configuration complete; ready for start up
proxy_1 | 2021/04/12 14:48:17 [emerg] 1#1: open() “/etc/nginx/conf.d/default.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:31
proxy_1 | nginx: [emerg] open() “/etc/nginx/conf.d/default.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:31
docker_compose_proxy_1 exited with code 1
db_1 | find: ‘/var/lib/mysql/’: Permission denied
db_1 | chown: changing ownership of ‘/var/lib/mysql/’: Permission denied
docker_compose_db_1 exited with code 1
proxy_1 | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
proxy_1 | /docker-entrypoint.sh: Configuration complete; ready for start up
proxy_1 | 2021/04/12 14:48:18 [emerg] 1#1: open() “/etc/nginx/conf.d/default.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:31
proxy_1 | nginx: [emerg] open() “/etc/nginx/conf.d/default.conf” failed (13: Permission denied) in /etc/nginx/nginx.conf:31
docker_compose_proxy_1 exited with code 1
api_1 | 2021-04-12T14:48:20.100302764Z: CRITICAL :arrow_forward: migration/Migrate 002 Migration failed: dial tcp 172.18.0.5:3306: connect: no route to host
db_1 | find: ‘/var/lib/mysql/’: Permission denied
db_1 | chown: changing ownership of ‘/var/lib/mysql/’: Permission denied
^CGracefully stopping… (press Ctrl+C again to force)
^CKilling docker_compose_proxy_1 …
Killing docker_compose_api_1 …
Killing docker_compose_frontend_1 …
Killing docker_compose_db_1 … done
^CERROR: Aborting.
[core@localhost docker_compose]$

Is that still on windows? Could be a permission issue with the way docker for windows handles the permission mapping from the host into the containers.

What matters is the user that is accessing the files (nginx or mariadb) in the container not if you run docker as root or not (I think you don’t even have a choice there).

hi,

this docker-compose runs on coreos fedora.

If i remember corretly i installed docker-composed as root. Are you saying i should try to install it as the standard-user again and try it? When i look into /var/lib/mysql/ for example, no such folder exists.

By default the docker daemon (the piece of software that actually runs the container) runs as root. But that has nothing to do with the user that is executing a program inside a container. Mariadb and nginx run with non-root users in their containers. That means they will try to create all volumes with the correct permissions when they are run the first time. If you create them by yourself before starting the container this can lead to permission problems since the user running the program in the container may have a different uid than the user you used to create the volume folder on the host.
Can you share your docker-compose.yml file?

I’d suggest you to look into how users and groups work inside of containers and how docker volumes work and how they map host folders and

Hi,

here is the content of my docker-compose.yml file:

version: ‘3’

services:
db:
image: mariadb:10
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_ROOT_PASSWORD: supersecret
MYSQL_DATABASE: vikunja
volumes:
- ./db:/var/lib/mysql
restart: unless-stopped
api:
image: vikunja/api
environment:
VIKUNJA_DATABASE_HOST: db
VIKUNJA_DATABASE_PASSWORD: supersecret
VIKUNJA_DATABASE_TYPE: mysql
VIKUNJA_DATABASE_USER: root
VIKUNJA_DATABASE_DATABASE: vikunja
volumes:
- ./files:/app/vikunja/files
depends_on:
- db
restart: unless-stopped
frontend:
image: vikunja/frontend
restart: unless-stopped
proxy:
image: nginx
ports:
- 80:80
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- api
- frontend
restart: unless-stopped

What are the permissions on the mounted folders and files?

Is this what you need? I guess this might be the anwser, I did everything as root. So the User of docker-compose cant manage it? What do you recomment me to do? should i recreate everything as a standard user?

total 8.0K
drwxr-xr-x. 4 root root 73 Apr 12 14:01 .
drwxr-xr-x. 4 root root 40 Apr 12 12:54 …
drwxr-xr-x. 2 root root 6 Apr 12 14:01 db
-rw-r–r–. 1 root root 887 Apr 12 13:32 docker-compose.yml
drwxr-xr-x. 2 root root 6 Apr 12 14:01 files
-rw-r–r–. 1 root root 210 Apr 12 13:33 nginx.conf

Try removing the db and files directory and then restart the containers (docker-compose down && docker-compose up -d). They will recreate the volumes automatically.

I was able to run the docker-compose up -d command without an error. Unfortunately the error still persists in the backround. (i guess because of -d for deattached)
The Log of the db service shows this:

2021-04-19T07:28:40.435377000Z 2021-04-19 07:28:40+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.9+maria~focal started.
2021-04-19T07:28:40.626816000Z find: ‘/var/lib/mysql/’: Permission denied

I ran the up command as root, if i try it as a standard user the installation fails because of missing permission. The way i understood it, the user that runs the db or container is diffrent from the fedora user. How can i make sure the container user has sufficient permissions?

The db container will automatically create the folder with the permissions it needs on startup. But it will only do that if there is no data present in that folder you’ve mounted. So, to solve your problem you should remove the ./db folder and restart the containers without recreating the volumes.
Check out the docs: docs/mariadb at master · docker-library/docs · GitHub

It does not matter what user you run the command as.

Again, I’d suggest you to look into how users and groups work inside of containers and how docker volumes work and how they map host folders and

i followed your advice and read some in your linked sites.

So as far as i understand, all containers are run as root by default. The user inside the container is detached from the kernel if not specified otherwise.

I tried to delete the db and files volumes and let docker create them. Unfortunately the error still persists. i understood that if i create the folder db, it might have wrong permissions for the container to work properly, but if docker is creating the folder/volume, it should work right?