One of the first steps after deploying a website project on Google Cloud Platform is to reserve a static IP address. The majority of technical problems experienced by Google Cloud Platform users occur because the user failed to reserve a static IP address for their website.
In this tutorial you will learn how to easily reserve a static IP address for your website on Google Cloud Platform.
Before starting this tutorial, you should have already deployed a website on Google Cloud Platform Compute Engine.
There are 2 methods in this tutorial:
1. Reserve an Existing IP Address
2. Reserve a New IP Address
Troubleshoot
That’s it!
By reserving a Static IP Address, you will prevent your site from breaking after server outages or restarts.
If you have any questions or comments, please post them below!
Thanks,
bk KALIA says
i have a working static ip with domain (tender84.com) mapped to google compute engine wordpress vm.
Later I created new wp vm with more settings, Now when I’m reassigning static existing ip to my new vm then it is not loading either by static ip address nor domain name. it was working fine without static ip.
So my query is, can we assign static ip to new google vm ? if yes then how to do it
Leron Amin says
Hi Bk,
You can change which IP’s are assigned to which instances by navigating to VPC network > External IP addresses.
There will be a dropdown next to the IP address allowing you to select which instance to assign it to.
Let me know if you have questions,
Joe
bk KALIA says
Exactly followed this process many times but new VM DNS never resolve …. Loading circle rotates endlessly.
I mean, i have working wordpress VM on ephemeral IP.
When I go to External IP addresses (with domain mapped) and replace its IP by attaching STATIC IP of other Production WP VM then Domain or Static IP never loads new wordpress in browser.
Leron Amin says
Hi Bk,
When you’re re-assigning IP addresses, it can sometimes take a while for the updates to reflect. Was the VM working correctly before assigning the new IP address?
Talk to you soon,
Joe
Paul says
Hi,
Bit of a noob question – can I use the static ID as a nameserver? I have a domain on a hosting site I am no longer using and want to make sure traffic ends up at my Google cloud site. I can’t port the domain over as it is not 60 days old yet.
Thank you for your great tutorials!
Leron Amin says
Hi Paul,
What do you mean by the static ID?
Talk to you soon,
Joe
Sunil says
I Have Assigned A Static Ip To My WordPress Website And Also Updated The Same In Cloud Dns A Record …..Website Is Loading But I Cannot Access Wp-admin Page Unable To Login Now That Just Doesn’t Load …How Much Time It Takes To Be New Static Ip To Be Fully Working
Leron Amin says
Hi Sunil,
It typically takes less than an hour. Did it start working?
Let me know and I will see how I can help,
Joe
Sunil says
Yeah It Worked …..Also The Permalink Error 404 Is Also Resolved By The Ftp File Permissions Error…Tha k You So Kuch For All The Tutorial ….Site Is Up And Running
Aaron says
Hi,
Thanks for this post. What I am trying to do is reserve additional IP addresses to use in Plesk so they can be assigned to an individual website instead of all of the websites using the same shared IP.
I have followed this step and it works just fine. However when I click to add another external static IP it does not allow me to attach it to the VM instance.
It may be outside the scope of this video perhaps due to my limited understanding, so I thought I’d ask a pro!
Leron Amin says
Hi Aaron,
I think it’s possible to attach multiple ephemeral IP addresses to a single instance, but the quota for static IP addresses is just one per instance.
So you’re running multiple applications on a single VM and are trying to assign a unique IP address to each one?
Talk to you soon,
Joe
peguy says
Hi ! thank you for all, your tutorial has really helpful.
I’m trying to do that but my own don’t working. when i clicking on SSH button nothing happent .
Leron Amin says
Hi Peguy,
What do you mean nothing happens? Do you have a pop-up blocker enabled?
Talk to you soon,
Joe
Valentino says
Hi OP, thanks for the tutorial, is the static ip cost will be deducted from the 300 credit?
Leron Amin says
Yes – the networking costs will be deducted from the $300 credit.
Coki says
Hi,
First of all, I have to say thank you for all your tutorials 😉
I’ve deployed WordPress via the click and deploy solution. At the begining It was possible to connect the compute engine VM via the IP which appeared in the “Deployment Manager” menu but now I don’t know why it don’t works anymore, my browser is loading everytime. It is true for the IP adresse and also for the IP adress with the “wp-admin” at the end.
On the other hand, I can access to the phpmyadmin configuration, and it’s the same IP.
Note : I’ve configured a static IP adress.
I really don’t understand why.. If you have any inputs 🙂
Regards,
Romain
Leron Amin says
Hi Coki,
Did you configure a domain name for the website on the VM?
If so, over time, the IP will begin to resolve to the domain name.
Also, what do you mean by, “At the begining It was possible to connect the compute engine VM via the IP which appeared in the “Deployment Manager” menu but now I don’t know why it don’t works anymore, my browser is loading everytime”?
Talk to you soon,
Joe
Coki says
Hi,
I configured a domain name for the website on the VM at the begining and after I deleted the cloud DNS API because I was thinking that it might be the cause of the issue.
So now I’ve got a VM with WordPress click and deploy on it and a static external IP for the VM.
When I’ve launched the VM with wordpress on it for the first time, it was possible to go to the wordpress admin panel but now I just cannot. I just can connect to the PHPmyadmin panel.
Thank for your help,
Coki
Leron Amin says
Hi Coki,
Deleting the Cloud DNS API will break your website configuration.
You will have to re-enable it and make sure your DNS A record matches up with the IP of your domain.
It sounds to me like there is a DNS issues – either your domains/IP address aren’t matching up, or you have a redirect in your Apache configuration that it causing problems.
Talk to you soon,
Joe
Egor says
Hello, thank you for your tuts, they help a lot. But, look, after I rebooted my instance my ephemeral IP has changed. (I was doing your auto back up tut) I reserved this new ephemeral IP as a static IP, What happens now I got the redirect to my old ephemeral IP, which happens even when I create a new VM under another static IP. How I fix that, as it is empty now?
Leron Amin says
Hi Egor,
This is a problem with your browsers cache and with DNS propagation. Unfortunately, it can sometimes take a day or two for the IP address change to fully take effect.
The first workaround is to try visiting your website through a free proxy/VPN and see if your old IP is still loading; this will bypass your browsers cache and give you an idea of which IP address your website is using in real-time.
As I mentioned before, this change can take awhile (sometimes a couple of days) – especially if your website had been using the same IP for a long time.
Hope this helps and let me know if you have any questions,
Joe
Allen says
Good descriptions, very useful. I did this on 7/1/18 so a little has changed in the layout of the GCP dashboard, but not enough to cause any problems following along with the video. So thanks for the work, saved me a lot of research and time! I do have one suggestion. like to read the feedback, before I do something like this. It would be great to have a button, arrow ect, to send you back to the top of the page.
Thanks,
Al
Leron Amin says
Hi Al,
I’m glad you were able to follow along despite the layout changes.
I will look into implementing a ‘back-to-top’ button, as I know many users will find this functionality useful.
Talk to you soon,
Joe
Swapan Kumar Manna says
Hello Leron,
Very nice tutorial. At first, I was not aware of it, now I understood what it really means. My website is running on GCP and learning day-by-day, since the first thing I do visit your website to get a solution. Earlier I just created an instance and installed Click-to-deploy WordPress. Now, I’m this to another Managed Group Instance. Since this is news website and traffic is increasing, I want to make sure we can handle traffic in future, that should have a proper Load Balancer and CDN. I have created Managed group instance and reserved an IP, but a day after I see the IP has changed an created another Ephemeral IP. Here is the screenshot – https://bit.ly/2IRDesF
Can you please let how I can reserve IP in Managed group? Or is this correct? Do I need to just reserve on VM Instance rather than concentrating Managed Group IP?
A reply will much be appreciated 🙂
Leron Amin says
Hi Swapan,
When used with a load balancer, instances in your instance group are meant to be dynamic – meaning they spin up (and die off) when certain criteria are met as defined by a health check or an autoscaler policy that you define when you configure the instance group. For this reason, it is not important to have a static IP address on the instance’s themselves, as the global (static) IP address is attached to the load balancer itself, which is required to distribute traffic among the VMs in your instance group.
Also – remember that load balancers and managed instance groups are expensive to both maintain (usage fees to Google) and configure (developer fees), so resort to load balancing only when you’re running an application with the profitability and daily traffic to justify the cost.
Let me know if you have any questions,
Joe
Addy says
Make a tutorial on static site how to create bucket on google cloud
Leron Amin says
Will do – thanks for the suggestion Addy!
Talk to you soon,
Joe
Jane says
Hi thanks for nice tutorials on gcloud and wordpress. i am using bitnami version of wordpress. i assigned static ip address and now i am getting 500 server error. what should i do?
Leron Amin says
Hi Jane,
Go to your CloudDNS and click on the zone for your domain name.
Next, make sure the IP address assigned to the A record matches the IP of your instance from the Compute engine > VM Instances page. Please let me know if you have any questions,
Joe
Wann says
I also experienced the same incident. It took several times to reload so that the page could be accessed. Even sometimes a “page not found” or “page does not respond” warning appears. Can you help find a solution?
Leron Amin says
Hi Wann,
The first thing that I’d recommend doing is to check your DNS – this is usually the root of these types of errors. Also, make sure that your DNS is configured for the correct instance IP address.
Let me know if you have questions,
Joe
Andrew says
There seems to be a change to Google Cloud Platform External IP address steps.
I followed your tutorial instructions. When I tried to select “Static” from “Ephemeral”, I was shown an option to “Reserve a new static IP address”. I had to key in a Name in lower case, with no spaces….? Is it possible for static IP address to be lower case letters???
Please see screen grab below.
http://i64.tinypic.com/34ybot5.jpg
I could not enter the ephemeral external IP address already assigned to my website.
I am worried that if I enter a new name, it will effect website functioning later.
What should I do?
Leron Amin says
Hi Andrew,
It doesn’t matter what name you assign to your IP address.
In the name field, you are only choosing what to call the static IP address, you are not choosing the static IP address itself. If you are switching an ephemeral IP address to static, then the IP address has already been assigned.
Let me know if you have any questions,
Joe
Greg says
Hi, thanks for the great tutorial. I don’t have much experience with gcloud, but needed some suggestions. If I am going to upgrade my server to high memory, can I reserve the IP of the instance and then restart the instance and after that delete the reserved IP. Will this lead to any issues.
Leron Amin says
Hi Greg,
It won’t causes any issue with the website itself – but it will probably cause some networking issues if the virtual machine running your website was already integrated with that IP address.
That being said, I don’t understand what the purpose would be of doing what you described in your question. If you could provide more details about your end-goal, I can offer some additional suggestions!
Talk to you soon,
Joe
David says
I never ever leave comments in posts but your blog has helped me SO much that I am seriously thankful for all the tutorials you have provided (much better than the ones created by Google even!). Thank you so so so much!!! It was straightforward and helped me get on the Google Cloud Platform… also, you should submit some of these to be added to Google’s tutorials, I think they would benefit greatly (and may provide monetary incentives back to you). Thanks again Leron!!!
Leron Amin says
Hey David,
Thanks so much for the feedback!
I am glad to hear that the tutorials have been helpful to you. 🙂
mohd zafar says
Excellent job amin .
1. Can you tell me if we are getting 300 dollar. And one year free.. that means 1 year we will not be charged and if if it charges 7 dollar that will be deducted from 300 dollar. Means 7 ×12 equal 84 will be deducted… Is it???
Means first year will be free??
2. Can we add google ads on wordpress sites.???
I am starting a new wordpress website should I go with blue host hostgator or I should avail one year free google cloud hosting to run wordpress
Plz tell me …..
My email is
[email protected]
Leron Amin says
Hi Mohd,
Thanks for the feedback!
You are getting a $300 credit to your Google Cloud account, which will disappear after one year if you do not use the full $300.
Certain necessary service charges, such as DNS charges, are not covered under the free tier. This means that, even though you have the $300 credit, it will still cost your around $1-2 dollar per month to host your WordPress website on Google Cloud.
Yes you can add Google ads to your website, but Google will not approve you to use Google Ads (AdSense) unless your website has enough traffic.
If you’re just looking for the simplest hosting provider, go with BlueHost.
Google Cloud is a very powerful platform for hosting websites, but there is a steep learning curve.
Let me know if you have any questions,
Joe
TARIK says
hello joe
great job as ever
my question is
how much cost static IP
i didn’t find answer in documentation
and in 3 GCP i mean for 3 clients in the first i have always 300$ of credit
the second 225$ and 65 day left
i didn’t understand how they calculate , you know it’s the same installation( absolutely the same )
thank you for everything
Leron Amin says
Hey Tarik,
In the cost example I used in this tutorial, the cost of using a static IP address was $7 dollars per month for the instance. I am not sure if this is an anomaly or not, but the cost was taken directly from the billing page.
For that reason, you could probably expect to incur a similar charge for using a static IP. You should remember, though, that you can typically run your instances without a static IP without incurring any issues – however, if you can’t allow for even the slightest possibility of website downtime, then you should stick to using a static IP address.
I hope this answers your question! 🙂
Joe
TARIK says
Yes very clear
thank you bro
Tarik
Leron Amin says
Hi Tarik!
I am glad that you found the instructions easy to follow! 🙂
Jovica says
What is the use of the static IP address?
Leron Amin says
Hi Jovica,
By default, your website is assigned an ephemeral [not permanent] IP address. However, many of your website’s components depend on a static [permanent] IP address in order to function properly. For example, users who do not use a static IP address may notice their website breaking down every time their server restarts.
Hope this answers your question!
Joe
Leron Amin says
What did you think of this tutorial?
Please share your questions and comments below!
Thanks,
Joe
Satz says
I Don’t generally comment on websites I read But Your tutorial has really helped me move my website under 30 mins.
I understand that when an instance restarts it changes the IP address. What if we don’t restart instance at all? Can we live with Ephemeral IP Address for a small WordPress site(10 – 20 visits a day)? or do we ‘have’ to use static IP for WordPress?
Leron Amin says
Hey Satz,
Great question! You can absolutely live with an ephemeral IP address, and if you are hosting a small WordPress site with 10-20 visits a day, there is really no reason to spend the extra money go to with static.
The static option is more important for large WordPress websites, with lots of DNS records and other advanced features that require a permanent IP address.
I hope this answers your question! 🙂
Joe