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

jandk4014's avatar

Running staging and production on same forge server? Best practices?

Simply put I've got a forge instance running my development site and database. Next week I want to change my DNS to point to a production site. I don't have the production site setup yet as I've just been running of the dev forge server.

  • Do I pay to upgrade my plan on Forge and create another sever? Since my database is on the existing dev server and I'll be developing more it makes sense to have separate boxes.
  • Do I just attach another site on the current forge server? This seems incorrect to me cause I'm not creating a sub-domain on the same box.

I totally expect that at some point I'll be breaking the DB on the development side. That stands to reason that I should have my sites on different severs.

So, do I spin up another server or forge. Map that hosted directory to my master branch on Git and let the good times roll. Or do I investigate Envoyer and see what that can do for me?

0 likes
5 replies
Cronix's avatar

It depends on what you want to do. It's not a problem just just set up multiple sites on the same server. They can even just be subdomains, like "testing.yoursite.com". All you do is create "testing.yoursite.com" in forge, and wherever your dns is hosted create an A record pointing to the same IP as your real site. Each site would have their own database, which you can create in the forge control panel, so they're independent of each other. They don't have to be on separate servers, but they can be. It depends on your budget and how busy your "real" site is (if on the same server).

So it just really depends on how you want to do it. I usually have the testing server on the same server, until there is enough reason to justify moving it to its own.

1 like
jandk4014's avatar

@Cronix-

Thanks for the info. So, I'll create different database creds in my env for the development site and production site. In forge I can all the directory anything I want. Let's say for example that I have this.

Dev site: http://www-dev.nike.com Production site: https://www.nike.com

Is my new forge site really going to host www.nike.com or do I access it by IP address? Ultimately, I want to get the production side all setup next week then flip the switch on DNS from the old site to the new site. What things do I need to watch out for with that?

Cronix's avatar

In forge I can all the directory anything I want.

When you create a new site, it will create the directory for the new site just like it did for your original. I just set it up so it does automatic deployments from the repo, using the testing branch instead of master (master is production site). It's just the same as when you set your original site up, except for the domain name would include the subdomain.

Then just go to wherever you have your DNS setup/hosted, and create a new Arecord to have "www-dev.nike.com" point to the same IP as your forge IP (just like you did for the original site, except it has the subdomain).

I would restrict access to your dev site and only allow your (and your teams) IPs to access it so the public/bots/etc can't.

So in Forge, select your server and go to "new site".

Root Domain: www-dev.nike.com
Project Type: General PHP/Laravel
Web Directory: /public

add site

it creates the site...

Then go to Site Details/Apps and set up automatic deployment using github or whatever you're using, and select the branch you want to use for testing.

Then go to your dns host and add the A record for www-dev.nike.com to point to your Forge Server IP

jandk4014's avatar

@Cronix - Just wanted to say thanks again for the help in the question. I ended up going with a new forge instance. Yes, you'll pay more but it's not worth the headaches of having the different sites (dev and prod) on the same server.

Cronix's avatar

No worries, I'm glad you have something working for your needs.

Please or to participate in this conversation.