Full Docker-Compose setup with Authentik OIDC and Caddy reverse proxy #1830
Replies: 6 comments 11 replies
-
|
Huge thanks! This helped me setting up my instance. I also emphasize the fact that roles are needed, not only groups. That's what I was stuck on. |
Beta Was this translation helpful? Give feedback.
-
|
Big Thanks of all here. It runs on Authentik 2025.10.2 |
Beta Was this translation helpful? Give feedback.
-
|
This is brilliant! Thank you all!!!! For future reference. I was getting stuck at a redirect URL. I ended up adding this to the Authentik provider.
But I was playing with Confidential vs. Public at the time. I may have been my own worse enemy there, but adding that doesn't break anything so I left it in. I am also using external Traefik instead of Caddy. Meaning my OpenCloud server is on a different VM than my Traefik server. To get Traefik working I am using: .env
Added a http:
routers:
opencloud-router:
rule: "Host(`cloud.example.com`)" # <--- change this URL
tls:
certResolver: letsencrypt # <--- change this certResolver
entryPoints:
- websecure
priority: 10
service: opencloud-lb
collabora-router:
rule: "Host(`collabora.example.com`)" # <--- change this URL
tls:
certResolver: letsencrypt # <--- change this certResolver
entryPoints:
- websecure
priority: 10
service: collabora-lb
wopiserver-router:
rule: "Host(`wopiserver.example.com`)" # <--- change this URL
tls:
certResolver: letsencrypt # <--- change this certResolver
entryPoints:
- websecure
priority: 10
service: wopiserver-lb
services:
opencloud-lb:
loadBalancer:
servers:
- url: http://<OC LAN IP>:9200 # <--- change this IP/URL
collabora-lb:
loadBalancer:
servers:
- url: http://<OC LAN IP>:9980 # <--- change this IP/URL
wopiserver-lb:
loadBalancer:
servers:
- url: http://<OC LAN IP>:9300 # <--- change this IP/URLYou can use the IP address of the OpenCloud server or an internally resolvable FQDN. In providers:
docker:
exposedByDefault: false
endpoint: 'unix:///var/run/docker.sock'
watch: true
file:
directory: /etc/traefik/
watch: trueWith a volume linking rules to a location Traefik will watch.
|
Beta Was this translation helpful? Give feedback.
-
|
Many thanks @jicka . |
Beta Was this translation helpful? Give feedback.
-
|
Hi, great post i am struggling to get it working with an admin user. Problem is that I followed authentik and opencloud instructions and it worked but whe I legged in, it create a new blank user (which is the default i believe) but I already had a local admin user which i setup when i first created the opencloud instance. So I have 2 questions if possible:
Btw I am using pangolin as reverse proxy if that helps Thanks |
Beta Was this translation helpful? Give feedback.
-
|
After having some issues migrating to 7.x versions, and seeing that there were improvements to the OIDC System as well as Euro-Office, I rebuilt my whole install from scratch. Here is an updated guide based on a fresh install of 7.2.0. Questions and ideas for improvements are welcome ! Setup Overview
OpencloudTo setup OIDC, I've created a new services:
opencloud:
restart: unless-stopped
environment:
PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD: "none" # Required for auth to work.
volumes:
- ./config/opencloud/proxy.yaml:/etc/opencloud/proxy.yaml # Required for role mapping
networks:
opencloud-net:
name: opencloud-netWithin the role_assignment:
driver: oidc
oidc_role_mapper:
role_claim: groups
role_mapping:
- role_name: admin
claim_value: opencloud-admin # <-- Authentik group name
- role_name: user
claim_value: opencloud-user # <-- Authentik group name
- role_name: guest
claim_value: opencloud-guest # <-- Authentik group name
additional_policies:
# [...]Finally, here is the full list of environment variables set in the .env file. LOG_DRIVER=
INSECURE=true
OC_LOG_LEVEL=info
COMPOSE_FILE=docker-compose.yml:weboffice/euroffice.yml:external-proxy/opencloud.yml:external-proxy/euroffice.yml:idm/external-idp.yml:idm/oidc-authentik.yml
OC_DOCKER_IMAGE=opencloudeu/opencloud-rolling
OC_DOCKER_TAG=latest
OC_DOMAIN=cloud.example.com
DEMO_USERS=false
INITIAL_ADMIN_PASSWORD=XXXXXXXXXXXXXXXXX
CHECK_FOR_UPDATES=true
LOG_LEVEL=WARNING
LOG_PRETTY=true
OC_CONFIG_DIR=/path/to/opencloud/data/config/
OC_DATA_DIR=/path/to/opencloud/storage
OC_APPS_DIR=/path/to/opencloud/data/apps
DEFAULT_LANGUAGE=en
LDAP_CERTS_DIR=/path/to/opencloud/data/ldap_certs
LDAP_DATA_DIR=/path/to/opencloud/data/ldap_data
START_ADDITIONAL_SERVICES=""
EURO_OFFICE_DOMAIN=eurooffice.example.com
EURO_OFFICE_JWT_SECRET=YYYYYYYYYYYYYYYYYYYYYYY
EURO_OFFICE_DOCKER_IMAGE=
EURO_OFFICE_DOCKER_TAG=latest
COMPOSE_PATH_SEPARATOR=:
PROXY_ROLE_ASSIGNMENT_DRIVER=oidc
GRAPH_ASSIGN_DEFAULT_USER_ROLE=false
IDP_DOMAIN=authentik.example.com
IDP_ISSUER_URL=https://authentik.example.com/application/o/opencloud/
IDP_ACCOUNT_URL=https://authentik.example.com/if/user/
PROXY_ROLE_ASSIGNMENT_OIDC_CLAIM=groups
OC_OIDC_CLIENT_SCOPES=
OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD=false
OC_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD=falseCaddyThe caddy setup is very simple. Here is the relevant portion of the caddyfile: cloud.example.com {
reverse_proxy opencloud:9200
}
eurooffice.example.com {
reverse_proxy euro-office:80
}The caddy container needs to be on the same network as the opencloud containers. The following lines are therefore added to the caddy services:
caddy:
# [...]
networks:
opencloud-net:
# [...]
opencloud-net:
name: opencloud-net
external: true
AuthentikFirst, create groups that will give access to opencloud, with a specific role:
Then create an application with provider. Here are the relevant settings:
Scopes:
Policy / Group / User Bindings: Add the three groups previously created Other providersHere are the client IDs and redirect URIs / Origins for the other clients:
iOS:
Desktop:
|
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
EDIT: See below for an updated version of this guide based on 7.2.0.
After (happily!) spending a lot of time tweaking all the environment variables, I think I have gotten to a satisfying state of things and can now start using / testing opencloud. I pulled together knowledge from many different places and wanted to put it all together if anyone else is interested.
Please let me know if this is not relevant / should be posted somewhere else.
Questions and ideas for improvements are welcome !
Setup Overview
Opencloud
To setup OIDC, I've created a new
oidc-authentik.ymlfile within theidmfolder. It expands the original compose file without having to touch it directly:Within the
config/opencloudfolder, add the Authentik domain tocsp.yamlunder connect-src:Within the
config/opencloudfolder, add the Authentik group to Opencloud role mapping toproxy.yaml(right at the top):Finally, here is the full .env file. Note that at the bottom, the OIDC values are set:
Caddy
The caddy setup is very simple. Here is the relevant portion of the caddyfile:
The caddy container needs to be on the same network as the opencloud containers. The following lines are therefore added to the caddy
compose.yml. This allows the caddyfile to reference the other containers as hosts.Authentik
First, create groups that will give access to opencloud, with a specific role:
Then create an application with provider. Here are the relevant settings:
slug: opencloud
Provider type: Oauth2 / OpenID
Client type: Public
Redirect URIs / Origins:
Scopes:
Policy / Group / User Bindings: Add the three groups previously created
Other providers
While not in use, here are the client IDs and redirect URIs / Origins for the other client types:
Android:
iOS:
Desktop:
EDIT 2025-11-22: Added caddy container to the opencloud-net network for direct intercontainer networking without the host. This is now necessary as the standard external-proxy compose files only bind the port to the container localhost. Removed limitation about apps as they now work (Thank you Ni0ki for the guidance!)
Beta Was this translation helpful? Give feedback.
All reactions