This guide will explain how you can test your site(s) locally from your Laptop / Computer after migrating your site(s) onto your new Cloudways server. It is a critical step in doing the final DNS changes and taking your site(s) live from Cloudways.
How to Test Your New Cloudways Application via Local Hosts File Changes
Step 1: Go to Application Management
Log into the Cloudways Platform with your credentials. Click on Applications in the top menu bar and then select your target application from the list.
Step 2: Add a Domain to Access Your Application
Click on the Domain Management section. Then add the Fully Qualified Domain Name (i.e. www.example.com) that your application uses. Finally, click Save Changes.
Once finished you should see the following message.
Step 3: Get the IP of Your Server
First, we find out the IP of our server from the Master Credentials section under the Server Management area.
Step 4: Add New Entry in Your Local Device Hosts File
Now we need to update the hosts file on your local device. We are showing it here for a Windows computer. Use equivalent tools for other systems / OS.
We open Notepad as Administrator.
Go to File -> Open and browse to the location of your hosts file (C: Windows\System32\drivers\etc\) and open hosts file. Make sure that (All Files *.* ) is selected in the file type section.
Paste your copied IP Address and type your domain name with and without www.
Click on File.
Now click on Save to save the changes.
After doing this process, your local device points to the Cloudways server for your application domain. You can now test all your website functionality while your users/customers continue to access the original server.
Once you are happy that everything is working smoothly on your new Cloudways server, you can proceed to make the necessary DNS changes to take your site live from Cloudways.
Remember to remove the host’s entry created above from your host’s file once you have performed the DNS changes.
That’s it! We hope this article was helpful. If you need any help, then feel free to search your query on Cloudways Support Center or contact us via chat (Need a Hand > Send us a Message). Alternatively, you can also create a support ticket.