ADMIN_TOKEN not configured correctly?

Hi I’m relatively new to self hosting and still learning. I’ve read some of the similar topics and am still confused.

I set my docker-compose.yml to the following:

services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: unless-stopped
    environment:
      DOMAIN: "https://vw.example.com"
      SIGNUPS_ALLOWED: "true" # deactivate this with "false" after creating all accounts
      ADMIN_TOKEN: RANDOMLYGENERATEDLONGSTRINGWITHALPHANUMERICS
    volumes:
      - /vw-data/:/data/

  caddy:
    image: caddy:2
    container_name: caddy
    restart: always
    ports:
      - 80:80
      - 443:443
      - 443:443/udp # Needed for HTTP/3
    volumes:
      #- ./caddy:/usr/bin/caddy
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - ./caddy-config:/config
      - ./caddy-data:/data
    environment:
      DOMAIN: "https://vw.example.com"
      EMAIL: "myemail@email.com"
      LOG_FILE: "/data/access.log"

I restarted the containers with sudo docker compose restart
But when I got to vw.example.com/admin it says

The admin panel is disabled, please configure the 'ADMIN_TOKEN' variable to enable it

What am I missing?

Thanks!

Figured it out. Needed to destroy the containers with sudo docker compose down and bring them back up.

docker compose up should be enough.
Restarting doesn’t work btw.

Your ADMIN_TOKEN need to be in hashed format generated from agron2 or opessl. Also, you need to put it in ‘single_quotes’ or “double_inverted_comma”. Then the hash contains some $uajdx value you need to skip every $ by adding $$ in it.

please let me know, if you have any doubts

So the plain text worked when I did a down then up as I mentioned on my reply.

I did also change it to the argon2 encrypted configuration 4 days ago. I used sed ‘s/$/$$/g’ to escape the $ with an additional $.

Still It’s not working ??

It is working just fine. Was I not clear in my two previous replies?

Yes you were, just asking if you have any other problems.