When someone joins this newsletter, I send a welcome email asking what they want to learn. Recently, someone was asking about provisioning and deployment, and I suggested they check out Forge and Envoyer.
This developer has servers on Google Cloud Platform (GCP), which is not mentioned anywhere in the Forge docs, so the question was: Can you use Forge with GCP?
I had actually done this exact thing on a previous project, so I dug out my notes, walked through the process to make sure it still worked, and will now share my step-by-step guide.
You start in the GCP console and provision a new VM instance. You cannot pair Forge with an existing instance, so you need to create a new one.
My first recommendation is to name the instance something that will help you remember it is managed by Forge.
For example, you could name the instance with a forge-
prefix.
You can pick any machine type you want, and any region, but it is absolutely critical that you pick one of the Forge-authorized operating systems. Currently, that is one of the more recent Ubuntu LTS releases, but check the Forge docs for the up-to-date list.
You'll also want to make sure that you enable HTTP and HTTPS traffic in the firewall settings.
Finish the VM creation process, and SSH into the new instance using the GCP console. By default, the root user is not allowed to SSH into the instance, but Forge requires this, so follow these instructions to enable root SSH access with your public key.
With this set up, you're now ready to continue the setup in Forge, so log in over there.
As previously mentioned, there's no GCP option when creating a new server in Forge, so you'll pick the "Custom VPS" option instead.
I like to match the name of the Forge server to the name of the GCP instance to keep things clear, but it is not a Forge requirement.
Provide the public IP of your new VM, and make sure to pick the same version of the OS that you used when creating the VM in GCP.
When you click "Create Server," Forge will give you a script.
Copy that script, SSH in to your server as root
, and run the script.
It's going to run for a while, but once it's done, your server is now provisioned and ready to use.
As one final step, I'd also lock down SSH access to only allow my IP address and the authorized Forge IPs.
Here to help,
Joel
P.S. Need help and don't want to wait for me to write a tip about it? Book a get unstuck session with me, and we can work through it together.