droplet terminal login

How To Transfer WordPress Website To DigitalOcean [Step By Step]

Tutorial     FAQ

DigitalOcean is one of the leading cloud infrastructure (“VPS Hosting”) providers in the world. For years ,I was hosting my websites on shared hosting plans (provided by companies like HostGator, iPage, DreamHost, SiteGround, Godaddy and others). Then, one day I noticed some of my websites are super slow, and the downtime was horrible. So, I decided to switch to “VPS Hosting”, and was shocked by the prices. Managed VPS hosting (which has cPanel most of the times) is very expensive.

After some time, I came across a VPS hosting provider named DigitalOcean (Register using this link to receive $10 – 2 month worth of VPS hosting. No coupon code is needed). I will be honest with you – at first I was not sure I would not be able to set my own server there, install WordPress, and transfer all my websites from shared hosting to the new server. Their servers are not managed and don’t come with cPanel. Everything is controlled via the Linux terminal.

Well, I did it ! It was super easy, but defiantly took me some time to get a hold of everything. Today I would like to help you transfer your website from your shared hosting company to DigitalOcean. After transferring  my websites to my server on DigitalOcean, I preformed uptime and speed tests daily. My websites are 2-3 times faster (amazing ! and gives some SEo boost as well) now and with 100% uptime.

digitalocean speed

This is a speed test of one of my website that I host on DigitalOcean. Do a test on Pingdom and see if you can get anywhere close to this speed.

Step 1 : Create A Digital Ocean Account

Use this link to open a DigitalOcean account. You will receive $10 credit after the first deposit (5$ minimum). No coupon is needed.

DigitalOcean’s cheapest plan is just $5 a month (for one “droplet” – DigitalOcean’s servers are called Droplets) .  This cheap VPS has 512 MB of RAM and 1 core CPU. It is more than enough for small and medium websites. I host 5-6 websites on one droplet, and receive around 20,000 visitors monthly. No problems at all ! With a good cache plugin, this small droplet (“server”) can handle much more visitors. Do remember that you can resize your droplet with one click of a button. So, if your website is featured on Reddit for example – and you receive 50,000 visitors in 24 hours, you can temporarily resize your server (add more CPU power and RAM), and pay hourly. That will also allow you to smoothly grow your websites. You can always upgrade your server without transferring everything again.

 

Step 2 : Backup Your Website

Login to your WordPress website (which is still hosted on shared hosting of course) as an Admin and install the UpdraftPlus plugin. Don’t forget to activate it.

updraftplus

  • Go back to your WordPress Admin Dashboard.
  • Hover over “settings” and choose “UpdraftPlus Backups”.
  • Click “Backup Now” and make sure “Include the database in the backup” and “Include any files in the backup” are selected.
  • Click “Backup Now”. Wait until the backup is complete (If you website is big, it may take some minutes).
  • Go to the “Existing Backups” tab.
  • See that “Backup data” section? Click on all buttons and download all backup files to a new folder that you can easily find later on.
  • That’s it ! You have all the files needed to transfer your website to Digital Ocean. Continue to the next step !

backup

Step 3 : Create A Droplet On DigitalOcean

  • Login to your DigitalOcean account and click on “Create Droplet” (located at the header).

digitalocean droplet

Choose Ubuntu : (Don’t choose “WordPress” from the “one click apps” tab !!)

digitalocean ubuntu

  • Choose size. For small websites (0-20,000 visitors a month) you may start with the $5 plan. If you plan on hosting multiple websites on one droplet / need more SSD storage space /need more transfer TB choose the $10 or $20 plan.
  • Choose a datacenter region. If most of your visitors are from USA, choose New York 2/3.
  • Select additional options. If you want your server to be backuped weekly, select “Backups”. Do keep in mind that it adds %20 to the droplet cost monthly. You will be able to backup your websites for free manually using the “snapshot” option that will be shown after deploying the server (“droplet”).
  •  Add your SSH keys : right now we won’t add any SSH keys. In the future you should consider using SSH keys to enhance the security.
  • Choose a hostname : choose a name for your server. It can be random as well. You can change the server name later on as well.
  • Click “Create”. Wait few minutes until the the server is created.
  • Go to your email and open the email that DigitalOcean sent you. There you will find the password and IP address of your droplet (server/VPS).

digitalocean email

  • We are almost done. Now, we need to change the password of our server (VPS – “droplet”). Click on “Droplets” (at the top of the page). Then, click on the name of the droplet you created.
  • Click on “Access” :

digitalocean terminal

  • Click on “Console Access”. A popup window will be opened. Click on the black screen and then press Enter. If it does not show anything, close the pop up window and click on “Console Access” again to reopen it.
  • Now linux asks for your login username. Type “root” (without quotes “”). Then click Enter to submit.

droplet terminal login

  • Now you need to enter the password that DigitalOcean sent you via email. You can’t copy-paste in the terminal, so write down the password on a piece of paper and then manually enter it in the terminal.
  • Now Linux asks you to change the password for security reasons. Choose a hard to guess password and write it down so you won’t lose it !

Step 4 : Install NGINX, PHP, MYSQL and WordPress 

Installing PHP, MYSQL, NGINX, APACHE, etc,, on your server can take you a lot of time. Let’s do it the smart way ! Go to ServerPilot and create an account. It’s free !

  • Now login to your ServerPilot account. Go to “Servers”. And then click on “Connect Server”.

digitalocean install wordpress

  • Enter the IP address of your DigitalOcean droplet (you can find it in the email they sent you after launching your DigitalOcean droplet).
  • Root password : enter the new password (remember that we changed the details password from the email for security reasons?)
  • Now click “Connect To ServerPilot” and wait until ServerPilot connects to your server. It will install PHP, NGINX and other necessary stuff.

After ServerPilot completes the confuguration, go to “Servers” and click on your server name. Then, click “Create App”.

  • Name : enter your website name (without com, dots or anything special. For example – webbizup).
  • Domain : enter your domain name without http://. We are talking about the website you are tranfering of course.
  • WordPress : Select it !  Then, enter a title (even a random one will work), and enter your current WordPress user and password (of the website you are trying to transfer to DigtialOcean).
  • Runtime : Choose the latest PHP version.
  • Click “Create App” and wait until it creates a WordPress website on your server.

serverpilot

Step 5 : Transferring The Files

Congratulations! We are almost done. Enter the IP address of your server (you can find it on DigitialOcean or in the email they sent you after launching your droplet) in your browser and click Enter. You will see a fresh WordPress website :

fresh wordpress

  • In the right sidebar you will see “Meta”. Click “log in”.

meta

  • Enter your WordPress username and password (the ones that you entered on Serverpilot – the user and pass of your website still hosted on shared hosting).
  • Hover over Plugins >> Add new. Search for “UpdraftPlus”, install and activate it.
  • Hover over Settings and choose UpdraftPlus Backups.
  • Click “Restore” and then “Upload backup files”.
  • Open the folder with your UpdfaftPlus backup files from step 2 of this tutorial.
  • Drag and drop all files (or “Select Files”).

restore

  • Click “Restore”. Keep in mind that in your case many buttons will be shown under Backup Data.

restrore backup

  • Choose all components.
  • Click “Restore” . Then click it again.
  • Wait few minutes until everything is installed.
  • Wow ! Now go to your server IP address and you will see your website up and running !

Step 6 : Change And Configure Domain DNS

Now, we need to make sure your domain name points to your DigitalOcean server (droplet). Go to your domain provider (The company yo uregistered your domain with. For example – GoDaddy, NameCheap, 1and1) and change the DNS to :

ns1.digitalocean.com

ns2.digitalocean.com

ns3.digitalocean.com

If you are not sure how to do that – check out this tutorial.

  • Go To DigitalOcaen and log in to your account. Click on “Droplets” and then >> “More”. Choose “Add a Domain”.

digitalocean DNS

  • Write your domain name without www. :

doamin

  • Click “Create Record”.
  • Under “Select Record Type” Click CNAME.

digitalcoean cname

  • Enter name : here you write www
  • Enter Hostname : write your domain name without www, and put a dot in the end. If your domain is domain.com for example, then you put “www” in the first field and “domain.com.” at the second field. Then press “Create CNAME Record”.

That’s it ! Everything is ready. Please wait up to 48 hours until the DNS updates. Most of the times it will take just few hours. Now, when you enter your domain name, your website will be shown (and be hosted on DigitalOcean).

How To Host Multiple Domains On One Droplet?

Actually, it’s very easy, but make sure you read the guide above again, before trying to transfer another website :

  1. Back up the additional site you want to transfer to the same droplet (check out step 2 in the guide above if you don’t remember how to do that).
  2. Go to ServerPilot, choose your server, then create another app (Select WordPress). Enter the name, domain, user and password of the additional website you are trying to transfer.
  3. Go to your droplet, choose “Add Domain” and add the additional domain (follow step 6 in the guide)
  4. Change the DNS of your additional domain to DigitalOcean’s DNS server (you can find it in the guide).
  5. When the DNS is updated, go to your domain, and you will find there a fresh Wordpress website. Login, install UpdraftPlus and upload the backup files.
  6. Done ! This way you can add pretty much as many domains as you want to one droplet.

Useful Terminal Commands

Download Putty to connect to your server and use the terminal. It works much better than DigitalOcean’s web terminal.
  • shutdown -h now  : Use to power off your server (useful if you want to create a backup/snapshot.
  • free -m   : check the free RAM.

FAQ

Why host with DigitalOcean and not use Shared Hosting ?

  • When you create a droplet on DigitalOcean – you can be sure that only your website is hosted on it. When you use a shared hosting – you are sharing the same server with hundreds of other people. It can hurt your SEO, and besides that – most web hosting companies overcrowd their servers, resulting in poor loading speeds and uptime.
  • Flexibility – You control your server ! Use the terminal and get access to stuff that shared hosting providers block. You can also easily resize your VPS in case a lot of visitors are coming to your website.
  • Price – DigitalOcean is super cheap. For $5 you get your own VPS. It can easily host few small websites.

Is DigitalOcean reliable? Should you host websites with it ?

DigitalOcean does have an uptime guarantee (you can check it out on their website) – but I care about what happens in reality. My websites are super fast with 0% uptime. I am satisified with their service, and really don’t see myself go back to shared hosting.

How much time does it take to transfer a website from shared hosting to DigitalOcean ?

The first time will take you about an hour. But later on, you will be able to transfer a whole website to your DigitalOcean server in 10 minutes (I do that even in less time). Believe me, at first it took my way more than an hour to transfer my website (since there are not too many detailed guides that show that. That’s why I decided to write my own guide). But now, I can transfer a website in 5 minutes.

Can I use a different backup plugin?

I tried many different backup plugins and found UpdraftPlus to work really well.  I used it to tranfer many of my websites to DigitalOcean and highly recommend you to use it as well. But, if for some reason you don’t want to use it – feel free to try any other backup plugin.

DigitalOcean doesn’t offer cPanel. Where is my file manager??

Calm down  ! Install this plugin.

How many websites can you host on one droplet (DigitalOcean server)?

I persoanlly host few websites on each droplet. If your websites are small and don’t receive much traffic – you can host many of them on one droplet. When they grow and you need more server rescues – just resize your droplet. If you want to, you can create a spereate droplet for each website (for SEO reasons, or just to hide your other websites from competitors).

Which droplet should I choose?

If you websites are small – start with the $5 plan. You will be able to resize your server later one anyways. But if your website is big and receives thousends of visitors a month, just go with the $10 plan, don’t waste time. You can use loader.io to test your server and make sure it can handle many visitors. You can also read this article on our website to learn how to make your website faster.

How can I get 2 month of free web hosting with DigitalOcean?

Use this link to register an account with DigitalOcean and you will get $10 credit (after you deposit money. You can deposit $5 at first if you are not sure you will use this service for a long time). I will receive free hosting credit if you use this link. If you found this guide helpful – please help me by registering using my link.

Are there any DigitalOcean alternatives?

Honestly, I think that currently DigitalOcean is the best VPS provider for WordPress hosting. But if for some reason you want to use other serivces – you check Linode and Vultr.

 

That’s pretty much it. I tried to make this tutorial as detailed as possible. If you have any questions – feel free to comment below.

Leave a Comment