# Setting timezone

**URL:** https://vaultwarden.discourse.group/t/setting-timezone/1333
**Category:** Help
**Created:** [December 23, 2021, 6:25pm UTC](https://vaultwarden.discourse.group/t/setting-timezone/1333 "2021-12-23T18:25:15Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Eirikr70](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@Eirikr70](https://vaultwarden.discourse.group/u/Eirikr70)
#### Post date: [December 23, 2021, 6:25pm UTC](https://vaultwarden.discourse.group/t/setting-timezone/1333/1 "2021-12-23T18:25:15Z")

</div>

Hello,  
I have a timezone problem on vaultwarden. Though it is not important, it makes it difficult to analyze vw logs together with those of nginx for instance : I have tried to set the env variable in the container, but it seems to be overridden by config.json file, which appears to not set the timezone. Should I edit that file ?

---

<div class="post-metadata">

### Author: ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)
#### Post date: [December 23, 2021, 7:57pm UTC](https://vaultwarden.discourse.group/t/setting-timezone/1333/2 "2021-12-23T19:57:42Z")

</div>

The Timezone isn’t set via the config.json file, neither saved.  
You should set it by adding the `TZ` variable using the correct timezone. Depending on how you are running Vaultwarden you probably need to `docker-compose up -d` or stop, remove, run the container again.

---

<div class="post-metadata">

### Author: ![Eirikr70](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@Eirikr70](https://vaultwarden.discourse.group/u/Eirikr70)
#### Post date: [December 23, 2021, 8:14pm UTC](https://vaultwarden.discourse.group/t/setting-timezone/1333/3 "2021-12-23T20:14:50Z")

</div>

Thanks for that (very) fast answer. I have tried setting it with portainer, with no success

 ![Capture d’écran du 2021-12-23 21-15-38](https://global.discourse-cdn.com/free1/uploads/vaultwarden/original/1X/86bf9cd0dc33e935b10f046d829330947113d19c.png)

I have also tried TZ instead of TIME\_ZONE.  
I’m on a pi 4 with 64-bit Raspi OS.

---

<div class="post-metadata">

### Author: ![Eirikr70](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@Eirikr70](https://vaultwarden.discourse.group/u/Eirikr70)
#### Post date: [December 23, 2021, 8:59pm UTC](https://vaultwarden.discourse.group/t/setting-timezone/1333/4 "2021-12-23T20:59:44Z")

</div>

I think it is a problem with my understanding of how to re-create a container with portainer : I have tried changing other variables and they seem not to have been taken into account.

---

<div class="post-metadata">

### Author: ![cksapp](https://avatars.discourse-cdn.com/v4/letter/c/b9e5f3/32.png) [@cksapp](https://vaultwarden.discourse.group/u/cksapp)
#### Post date: [December 23, 2021, 11:06pm UTC](https://vaultwarden.discourse.group/t/setting-timezone/1333/5 "2021-12-23T23:06:17Z")

</div>

Once you create a container you can simply delete the container and recreate it with the new settings. Certain data will persist if you have volumes set up such as the ./vw-data and your config.json file which will override any other CLI defined settings where they overlap at the container creation.

Containers are designed to be ephemeral and the os and other config can be easily brought down, load-balanced, and recreated as needed with data persisting on separate storage in certain scenarios.

Hopefully once you recreate the new container with the correct tz variable settings it’ll show logs correctly.

---

<div class="post-metadata">

### Author: ![Eirikr70](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@Eirikr70](https://vaultwarden.discourse.group/u/Eirikr70)
#### Post date: [December 24, 2021, 9:26am UTC](https://vaultwarden.discourse.group/t/setting-timezone/1333/6 "2021-12-24T09:26:26Z")

</div>

I succeeded in creating a new container with the right timezone. Thanks !  
Now my problem is trying to create it with docker-compose. Here is my docker-compose.yml

```auto
version: '3'

volumes:
  data:

services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: always
    ports:
      - 127.0.0.1:8080:80
      - 127.0.0.1:3012:3012
    environment:
      - WEBSOCKET_ENABLED=true
      - SIGNUPS_ALLOWED=false
      - DOMAIN=xxx
      - SMTP_HOST=xxx
      - SMTP_FROM=xxx
      - SMTP_PORT=xxx
      - SMTP_SSL=true
      - SMTP_USERNAME=xxx
      - SMTP_PASSWORD=xxx
      - ADMIN_TOKEN=xxx
      - LOG_FILE=/data/vaultwarden.log
      - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
      - TIME_ZONE="Europe/Paris"
    volumes:
      - data:/data

```

It doesn’t work for setting the ports : I guess I have a syntax problem.  
And my volume is named vaultwarden, but if I set it to vaultwarden a new vaultwarden\_vaultwarden is created instead. This is why I named it data, so the volume created is named vaultwarden\_data …

---

<div class="post-metadata">

### Author: ![Astraea](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@Astraea](https://vaultwarden.discourse.group/u/Astraea)
#### Post date: [December 24, 2021, 11:41am UTC](https://vaultwarden.discourse.group/t/setting-timezone/1333/7 "2021-12-24T11:41:21Z")

</div>

Your ports section should look like this:

```auto
ports:
   - 8080:80
   - 8443:443

```

---

<div class="post-metadata">

### Author: ![MilesTEG1](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/milesteg1/32/288_2.png) [@MilesTEG1](https://vaultwarden.discourse.group/u/MilesTEG1)
#### Post date: [December 28, 2021, 6:47am UTC](https://vaultwarden.discourse.group/t/setting-timezone/1333/8 "2021-12-28T06:47:20Z")

</div>

> [@Eirikr70](#):
>
> ```auto
> environment:
> - WEBSOCKET_ENABLED=true
> - SIGNUPS_ALLOWED=false
> - DOMAIN=xxx
> - SMTP_HOST=xxx
> - SMTP_FROM=xxx
> - SMTP_PORT=xxx
> - SMTP_SSL=true
> - SMTP_USERNAME=xxx
> - SMTP_PASSWORD=xxx
> - ADMIN_TOKEN=xxx
> - LOG_FILE=/data/vaultwarden.log
> - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
> - TIME_ZONE="Europe/Paris"
> 
> ```

And the time zone variable should be :

```yaml

environment:
      - TZ="Europe/Paris"

```

---

<div class="post-metadata">

### Author: ![MilesTEG1](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/milesteg1/32/288_2.png) [@MilesTEG1](https://vaultwarden.discourse.group/u/MilesTEG1)
#### Post date: [December 28, 2021, 6:54am UTC](https://vaultwarden.discourse.group/t/setting-timezone/1333/9 "2021-12-28T06:54:10Z")

</div>

And what is the path variable ???

And are you sure the data volume is persistent after a recreation of the container ?

You should learn a bit more about docket-compose.yml file 😇
