Migrate from Shared Hosting to Linode
Updated by Linode
This guide walks you through migrating your website from a shared hosting provider to a Linode running a LAMP stack. A Linode server gives you much more power and flexibility than a shared host, but these advantages come at the cost of increased complexity and responsibility.
The biggest change between shared hosting and Linode’s cloud is that with Linode you have full administrative access to the server without intervention. This means that solely you will be responsible for keeping your software updated and your valuable data backed up. Our Guides and Tutorials area contains all of the information you’ll need for basic server administration, security hardening and system backups.
Before You Begin
This guide assumes three things:
- You already have a Linode account.
- You know how to sign in to the Linode Manager.
- You have at least basic knowledge of how to use SSH.
See our Getting Started guide for more information on signing up and setting up your Linode.
Prepare Your Domain Name to Move
Start by lowering the Time to Live (TTL) for your domain so the migration won’t have a negative impact on your site’s visitors. TTL tells DNS caching servers how long to save information about your domain. Since DNS addresses don’t often change server IP addresses, TTL is normally about 24 hours.
When changing servers, however, you want a low TTL to make sure that when you update your domain information, it takes effect quickly. Otherwise, your domain could resolve to your old server’s IP for up to 24 hours. However, changing TTL is not a guarantee because caching DNS servers ignore TTL, but it does the most to make sure that your site has a smooth transition.
-
Locate your current nameservers in your shared hosting provider’s account control panel. If you’re not sure what your nameservers are, you can find out with a Whois Search tool. You will see several nameservers listed, probably all at the same company.
-
Contact your domain registrar for details on how to lower the TTL for your domain. Every provider is a little different, so you may have to ask for instructions.
-
Make a note of your current TTL. It will be listed in seconds, so you need to divide by 3600 to get the number of hours (ex: 86,400 seconds = 24 hours). This is the amount of time that you need to wait between now and when you actually move your domain.
-
Lower your TTL as low as it will go. 300 seconds = 5 minutes, so that’s a good choice if it’s available.
-
Make sure you wait out the original TTL from Step 3 before actually moving your domain. In the meantime, you can continue through this page to back up your data, deploy your Linode and upload your website. For more information on domain TTL, see our DNS guide.
If you can’t lower your TTL, it’s not the end of the world. The first day or two of your transition to Linode may be a little bumpy, but your updated domain information will eventually spread throughout the internet, and in less than a week you won’t notice any difference.
Back Up Your Website
The next step is to back up your site from your old server to your desktop. There are multiple ways to do this, though you may find it easiest to work directly through your host’s control panel from your web browser. The location of your website on the server will vary among hosting providers, though it should be something along the lines of /home/account_name/public_html.
You may want to explore whether the application you use for your website has its own backup instructions, such as the combination of WordPress and phpMyAdmin, for example. Regardless of backup method, every website is made up of files and databases so you can use the instructions in this section to back up every type of website.
If you have a MySQL or MariaDB database on your old server, you need to back it up, too. Your old host probably has a control panel that will allow you to make an easy backup of your database. Contact them for instructions. If your old host does not have a database backup solution, you can follow our instructions to Back Up Your MySQL Databases using the command line.
Shared Host’s Control Panel
CPanel and Plesk have their own backup methods, in addition to being able to create a single .tar.gz or .zip file from within their file managers for you to download.
Terminal (Linux / OS X)
Linux and OS X can use SCP natively from the command line. To download your client’s tarball to your local user’s home directory using SCP:
1 | scp example_user@server_ip_address:/home/account_name/public_html ~/ |
FileZilla (Linux / OS X / Windows)
See our Filezilla guide to use it for your site backups.
Install a Basic Web Server on Your Linode
The next step is to build the software environment needed for your site to function properly. Linode provides prepackaged software options called StackScripts that make it easy to deploy software stacks in just a few clicks. We’ll go over detailed instructions for installing the basic LAMP web server. From there, you can install a content management system of your choice such as WordPress or Drupal.
LAMP Stack
LAMP stands for the following:
- Linux: Linode offers a LAMP StackScript for CentOS, Debian and Ubuntu. Which Linux distribution you choose is up to you. While there will be no discernible difference to your site’s users, each distro has its own positives and negatives.
- Apache: A web server that handles HTTP and HTTPS internet traffic.
- MySQL: A database server.
- PHP: A software language that lets you have dynamic website content.
-
After you select a data center for your Linode, you’ll be prompted to deploy a Linux distribution. Select the option to Deploy using StackScripts.
-
Select linode/LAMP Stack.
-
Fill in the requested details. The example given is for a new Drupal site:
- MySQL root Password: Enter a strong password and make note of it. This will be the highest-level password for your database.
- Create Database: Enter a name for your database, if desired.
- Create MySQL User: You should create a secondary user for your database so you’re not working in it as the DB’s root user.
- MySQL User’s Password: This is the password for your new database user.
- Distribution: Choose your preferred Linux distro. If you are relatively new to Linux, the newest Ubuntu LTS is a good start because it has five-year release cycles and widely available support.
- Deployment Disk Size: Leave the default setting.
- Swap Disk: Leave the default setting.
- Root password: Not to be confused with the MySQL root uesr’s password, this root password is the master key to your Linode. You want a strong password here, and ideally, to later remove password access to your Linode in exchange for SSH key authentication.
-
Click the Deploy button. You will be redirected to your Linode’s Dashboard. Watch the Host Job Queue. You should see a number of jobs in progress.
-
When the Create Filesystem job is done, click the Boot button under your Linode.
-
To verify that LAMP installed correctly, check that a basic website framework has been added to your server. To do that, your IP address must be used since your domain isn’t pointing to Linode yet.
To find your IP, go to the Remote Access tab. Your IP will be in both the SSH Access and Public IPs sections. i
-
Open a new browser tab and paste the IP address into the address bar. You should see Apache’s test webpage.

-
Install Additional Software
If you need to install more software such as Drupal, cPanel or Ruby support, you have two options:
-
Search through our database of StackScripts for the combination of software you’re looking for.
-
Install the software manually using pages from Linode Guides & Tutorials or the general internet as references.
-
Get Your Website Live
Once you’ve installed all the underlying software for your Linode, you can upload your website to the new server. This will replace the Apache test page shown earlier with your actual website.
-
Follow these steps to configure name-based virtual hosts for Apache on your Linode.
-
Upload your website’s files from your local computer to
/var/www/example.com/public_htmlon your Linode. The process to do this is similar to how you downloaded your site’s files to your local computer when creating a backup from your shared host. The only differences are the source and destination of the transfer.For example, to upload to your Linode using SCP on Linux or OS X:
1
scp ~/example.com example_user@server_ip_address:/home/example.com
example_useragain should be the user on your Linode you want to log in as.If you have a database, you’ll need to upload it to your Linode. If you’re more comfortable using a control panel, you may want to install phpMyAdmin at this point. You can also restore your database using the command line.
-
Now check your website’s IP address in your browser like you did earlier. Your website should be visible.
Your website may not function completely correctly if it is URL-dependent. A website created with WordPress is an example of a URL-dependent website. Because you’re using the IP address instead of the URL, WordPress gets confused. It should start working correctly once you move your domain to point to Linode.
A Note About Email
A Linode can run both your web server and an email server for your site. If you use a separate email host like Google Apps, you will need to make sure you preserve the correct MX records for email when you move your domain. If you use a mail service at your old host, you may still need to consider where you’re going to move your email.
Move Your Domain
The last step in your Linode migration is to point your domain at your Linode’s IP address. If you decided to lower your TTL, make sure you’ve waited out the original time period.
-
Follow these instructions to create DNS records at Linode for your domain.
-
If you use a third-party email service, edit the default MX records.
- Log in to your domain registrar’s control panel and update the nameservers to use Linode’s:
- ns1.linode.com
- ns2.linode.com
- ns3.linode.com
- ns4.linode.com
- ns5.linode.com
-
Wait five minutes for the domain to propagate. If you did not lower your TTL first, this can take up to 48 hours.
-
Visit your domain in a web browser. It should now be showing the website from Linode, rather than your old host. If you can’t tell the difference, you can use the DIG utility. It should show the IP address for your Linode.
-
Set reverse DNS for your domain so you don’t have any mail problems.
If you’re having trouble seeing your site at the new IP address, you may need to try visiting it in a different browser. Sometimes your browser will cache old DNS data, even if it has updated everywhere else.
Your website is now fully migrated to Linode. It would be a good idea to wait a few days before cancelling your shared hosting service to make sure that everything is running smoothly and you don’t need to grab more files from your shared host for any reason.
Next Steps
Your server is only as secure as you make it. You should follow our Securing Your Server guide to make sure your Linode is hardened against unauthorized access.
This guide is published under a CC BY-ND 3.0 license.





