After testing out the functionalities of WordPress, I decided to host my blog on DigitalOcean instead of wordpress.com. There are several reasons behind this:
- I want to customize my website, including using my domain name, trying out different color palettes of the themes, but don’t want to buy a WordPress subscription
- I still want to keep the old website’s content and style, instead of building from scratch
- I want to have more control of the backend infrastructure
This post outlines the steps I took to achieve it. It provides some extra information based on this official tutorial on how to use the WordPress 1-Click Dorplet.
Get a domain name
I bought this domain name trashpandadreamland.online
from Namecheap for $1.72 per year. You can choose other domain name registars as well.
Get a DigitalOcean personal account
It is free to register an account but you need to link your payment method (credit/debit card or Paypal). I also received a $200 credit for 60 days after creating my account.
Add the domain to DigitalOcean
Follow this tutorial to setup the domain name on DigitalOcean, which allows you to manage the DNS records through the DigitalOcean’s control panel. This is how the DNS records for your new domain should look like in the control panel:
Create a WordPress Droplet
Use this free app on DigitalOcean Marketplace to create a WordPress Droplet.
For the size and CPU option, I chose the cheapest one, which is currently $6/month.
Add the SSH public key of your personal computer to the Droplet.
Give it a more human readable hostname such as wordpress-blog
.
Finally click on Create Droplet
. Boom! You have a VM running on DigitalOcean’s server now.
SSH into the droplet and follow the setup script
Before doing this step, make sure that your DNS records are all set up, or otherwise the setup will fail.
After making sure that the DNS records are in the right place and your domain’s delegation is DigitalOcean’s name server, SSH into the droplet and follow the setup script.
Make sure to enable the HTTPS for your new website. It is 2024 and nobody will visit a website with only HTTP!
If there is no error after running the script, wait for at least half an hour for everything to take effect.
If you encounter any issue during the setup process, you might need to rebuild your droplet using the image WordPress 6.4.5 on Ubuntu 22.04 and run it again. It probably has a way to rerun the script but I haven’t found it yet.
Import blog contents from the old website to the new one
Visit your new domain in browser to see if everything has come into effect. It should show a default website home page with a sample post called “Hello World”.
On your old WordPress website, log in as the admin. On the left side menu bar, navigate to Tools -> Export, then click on Export All under Export content. You will recieve a link to download your existing contents as a xml
file in your email.
To import the contents to your new website, visit https://<your-domain-name>/wp-admin
to log in the admin’s view. The username and password are the ones you entered through the setup script in the Droplet.
Navigate to Tools -> Import, click on Install now under the WordPress section and then Run Importer.
Upload the XML
file you just received in your email.
If imported successfully, you should be able to see the old contents and pages in your new website.
For the appearance, I had to update it manually. Thankfully, there was not much to do, I just chose the theme that is used on my old blog and made some minor tweaks. If your website’s appearance is more complicated, you might want to look into some migration plugins provided by wordpress.com.
That’s it. Hope you find this tutorial useful! Feel free leave a comment if you have any question.
Leave a Reply