I’m new to Digital Ocean. I set up a WordPress website on a droplet, attached it to a subdomain and secured it with let’s encrypt. I was impressed with the speed of the server compared to my current host, so I have re-built(and improved) my small business website in that new WordPress installation. I want to change my business domain so that it is pointing to the droplet IP address and encrypt it using let’s encrypt. The domain I want to use (and do own) is pointing to my old website at a hosing company. I can’t figure out quite how to do make this change. When I open the terminal using access, it seems to want to install a new instance of WordPress and I don’t want to risk overwriting the website. Suggestions?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Heya @andreagrebenc,
Basically, you want to point your actual domain to your new DigitalOcean Droplet and make it show the rebuilt website you built on your subdomain, is that correct?
If, yes, your situation involves several steps, and they can all be done without any risk to your current website setup.
Changing the Domain Name System (DNS) records: You’ll first want to modify the DNS records of your business domain to point to the IP address of your droplet on Digital Ocean. To do this, you’d have to log into the platform where you purchased your domain (e.g., GoDaddy, NameCheap, etc.), then navigate to the DNS settings for your domain. You’d need to change the ‘A’ record to point to your Digital Ocean droplet’s IP address. Remember, DNS changes can take up to 48 hours to fully propagate across the internet.
Set Up your new domain on the droplet: After that, you will need to set up your new domain on your droplet. If you used a LAMP stack to install WordPress, this would involve setting up a new virtual host file for your domain. This can be done by duplicating the existing configuration file for your current website, and just changing the domain name and directory location.
Configure WordPress to use the new domain: The next step is to update the WordPress site URL and home URL to reflect the new domain. You can do this by logging into your WordPress dashboard, going to ‘Settings’, and then ‘General’. Enter your new domain in the ‘WordPress Address (URL)’ and ‘Site Address (URL)’ fields. Make sure to include ‘https://’ before your domain name.
Setting Up Let’s Encrypt: The last step is to set up Let’s Encrypt SSL for your new domain. You can do this using Certbot, a free, open-source tool provided by the EFF. If you’ve already installed Certbot for your subdomain, you’d just need to run it again with your new domain.
Here’s a basic Certbot command that you could use, replacing
yourdomain.com
andwww.yourdomain.com
with your new domain name:After running this command, Certbot will guide you through the process of obtaining and installing a new SSL certificate. Make sure to choose the option to redirect all traffic to HTTPS when asked.
Note: Certbot commands could differ slightly based on the OS and web server in your droplet. I used Apache in the above example as it is one of the most common web servers used with WordPress.
Remember to test your website thoroughly after implementing these changes to ensure everything is working as expected. If you run into any issues or have questions about specific steps, feel free to ask!
Lastly, remember to take backups before making these changes. You can use Snapshots for that :
https://docs.digitalocean.com/products/images/snapshots/
Snapshots are on-demand disk images of DigitalOcean Droplets and volumes saved to your account. Use them to create new Droplets and volumes with the same contents.