Skip to content
Picture of Team Lando
Team Lando

How do I set the timezone of a Lando service?

If you need to set the timezone of a Lando service here is how! Just symlink the appropriate timezone you need in a run_as_root build step. Here is an example .lando.yml file.

yaml
name: timezone
recipe: lemp
config:
  webroot: .

services:
  appserver:
    run_as_root:
      - ln -snf /usr/share/zoneinfo/America/New_York /etc/localtime
      - echo "America/New_York" > /etc/timezone

Just copy the run_as_root section into your services key for any service you need it for, i.e. appserver, database, or whatever service you need to set. Be sure to swap out America/New_York to the timezone that you need.

Tested on Debian only

Note that we test this on Debian flavored services so these instructions might differ slightly or be unapplicable for non-Debian services.

Then run a rebuild:

bash
lando rebuild -y

and you'll have the timezone set in those services.