# How to set up Kanboard with SWAG

**URL:** <https://kanboard.discourse.group/t/how-to-set-up-kanboard-with-swag/3047>\
**Category:** Installation Issues\
**Created:** [February 2, 2024, 1:47am UTC](https://kanboard.discourse.group/t/how-to-set-up-kanboard-with-swag/3047 "2024-02-02T01:47:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![amca01](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/amca01/32/1829_2.png) [@amca01](https://kanboard.discourse.group/u/amca01)\
**Post date:** [February 2, 2024, 1:47am UTC](https://kanboard.discourse.group/t/how-to-set-up-kanboard-with-swag/3047/1 "2024-02-02T01:47:41Z")

</div>

Here’s how I managed to get Kanboard up and running, with SWAG as a reverse proxy that manages TLS certificates from letsencrypt.

First, since I’m using subdomains in SWAG, I set up an A-level subdomain with my domain name hosting service, called “[kanboard.mysite.net](http://kanboard.mysite.net)” (Well, not quite, but you get the idea). Then I waited for about a day to ensure that this new URL had propagated globally. (In fact I don’t know how long this takes, but a day is certainly long enough. Maybe a few hours would do it.)

Second, in my SWAG settings in `docker-compose.yml`, I had the line

```auto
  environment:
    -- subdomains=kanboard

```

In fact I have several subdomains, whose names are listed here, separated by commas.

Third, I simply copied the kanboard docker-compose file and made some changes:

1. I left out the “443:443” ports line: this port is used by SWAG.
2. I left out the kanboard\_ssl volume, as ssl is handled by SWAG.

This left:

```auto
kanboard:
    container_name: kanboard
    image: kanboard/kanboard:latest
    ports:
      - "8080:80"
    volumes:
      - kanboard_data:/var/www/app/data
      - kanboard_plugins:/var/www/app/plugins
    environment:
      DATABASE_URL: mysql://kanboard:kanboard-secret@db/kanboard
      PLUGIN_INSTALLER: true 

```

The database lines, starting with `db:` I left untouched.

Fourth, I needed to create a kanboard config file in my `swag/nginx/proxy-confs` directory. SWAG provides a template for this, and so it’s just a matter of filling out a few fields. Without all the comment lines, the final file, called `kanboard.subdomain.conf` is:

```auto
server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name kanboard.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location / {

        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app kanboard;
        set $upstream_port 80;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }
}

```

Then I restarted SWAG with `docker restart swag`. This needs to be done after any change to a config file.

And that’s it! I started my containers with the usual

```auto
docker compose -f docker-compose.yml up -d

```

and I was good to go. (Note that I’m using the “compose” tool of docker, instead of the deprecated “docker-compose”. If you’re still using docker-compose, you need to update.)

Hope this helps someone.
