special sponsors

How do I set the timezone of a Lando service?

Written by: Team Lando Team Lando
Guide Tested: Yes

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.

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:

lando rebuild -y

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

Have a Lando question you'd like to see as a guide? Suggest one!
Want to write a Lando guide? Learn how!