Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mattstowe's avatar

Vapor in multiple regions

Has anybody managed to find a solution to dealing with multiple region deployments within the same vapor project? For example I would like to deploy staging-eu.domain to EU region and staging-us.domain to US region.

It does not seem possible to specify different region for environments within the same vapor project. Having different projects per region is a pain and something I want to avoid!

Any help welcome!!

0 likes
3 replies
hallindavid's avatar

I'm asking this same question as well.

I think the solution is going to be saving multiple vapor.yml, then renaming the one you want to deploy back to vapor.yml before deploying. Then you have multiple vapor projects, one for each region.

Doing the same thing except with Canada & US

hallindavid's avatar

Ok - I found something interesting.

https://github.com/Snowfire/vapor-on-different-environments I asked on the serverless laravel slack group, someone recommended this.

I just did it with my deployment, and it seems to work pretty well.

Basically you do 2 projects, set up one in each region, and you'll have 2 vapor.yml files. (for me)

vapor.canada.yml vapor.usa.yml

then you can modify those scripts in the link so they will work for you. Basically you'll want to have a script that

  1. copies the vapor file for the region of interest into vapor.yml
  2. runs the desired command
  3. deletes the vapor.yml file

or without the script, you can just do it manually, and that works too.

Hope this helps!

mattstowe's avatar

Yeah thanks - thats a good solution actually - nice one! I'll probably add this to a Makefile to keep things simple.

Please or to participate in this conversation.