In this blog, I’ll share with you my experience in how I get my current site up and running. I’ll try to help you to avoid many problems when you get start your site on Linode server, especially if you new like me.
Keep talking and let’s begin.
Install your server on Linode
Secure your server
The next step is secures your server and also Linode gives you some help tips & tricks to do that, of course you can pick up what you need and leave the other, it’s not a necessary to follow all the instructions because you may don’t need them all now. please find the article here.
Configure your DNS and connect it to your domain
Install LAMP Stack
Now your server ready to host your services, and the main one install LAMP Stack on your server. And also Linode gives you very easy documentation for this, and here you’ll find how to do this on Ubuntu 16.04.
please note when you install your PHP you’ll need those PHP libraries to run you WordPress correctly after that.
sudo apt-get install php-curl php-gd php-mbstring php-mcrypt php-xml php-xmlrpc
Upload your WordPress site
Now your server ready to host your site, you have now a server and LAMP Stack on it. In this step you have several choices you can choose from them.
You can follow Linode article if you start your site from scratch and you’ll do everything online, but if your case like my case that you’ll do things locally first and upload them later on your server, Linode docs will not help you a lot!.
In my case, I used Git on my local machine and pushed my code after that on my Bitbucket account, now my code on Bitbucket so I can clone it on my Linode server, of course, to do this you need first to install Git on your Linode server, connect to your server via SSH user and write following command.
sudo apt-get install git -y
Now your Git installed, after that navigate to your host folder
/var/www/html/your-site-name/public_html/ by using
cd command and clone your code using the following command.
Please note that you need to change
REPO-URL with your link, you’ll find that link on your git host providers ( in my case is Bitbucket ).
git clone https://REPO-URL.git .
OK, now you have a site files on your server, Hooray!
The main benefit of using git is that you can now trace your code changes and have a copy of it on another server as a backup.
But If you don’t use git, you have last two choices.
First one is using FTP clients like FileZilla or Winscp on Windows OS, and upload files from them, Linode provides article for that purpose.
Second one is using
scp command through your terminal.
scp /path/to/source-file user@host:/path/to/destination-folder/
Upload your database
OK, now by anyway you chosen to update your files, It’s now on your server. Now we have an important step to make your site works, It’s update your database.
If you create your database from scratch, you don’t need this section you can directly go to your domain and start your WordPress site. But if you have already database on your local machine and you need to upload it, then follow me.
If you’re not familiar with a terminal, you can use programs like Mysql Workbench or any others to connect your server and upload your database, but I’m not preferring this way.
Another way is using the terminal to do this task.
Please note that you’ve already created a database and assign a user to it on Install LAMP Stake section.
First upload your
database.sql file to your server.
scp /path/to/database.sql user@host:/~
After that import it to your database.
mysql -u username -p database_name < database.sql
It’ll ask you for a password and that’s it, your database is ready.
Launch your WordPress site
If you start your site from scratch, then go to your site domain
example.com and insert your information like the site name, database name, password and the other stuff.
But if you upload your site, there’s a last step, login to your server by SSH user, then navigate to your site path, and open
wp-config.php file by nano program.
sudo nano wp-config.php
And edit the following lines with your correct credentials.
/** The name of the database for WordPress */
/** MySQL database username */
/** MySQL database password */
Enter, now you saved your correct information. Go to your domain and It’s work. Congrats.
Change Your Permalinks path
Again skip this step if you start from scratch, If you don’t, you have two ways, first update your database from table
wp_options then change the two following keys
home to your domain name, another way by simply go to your admin in path
example.com/wp-admin then enter your username and password, then go to
settings > permalinks change the two values from your local path to your domain path.
In this long tutorial we learn how start our WordPress – or any other site – on Linode server, in both ways if you start from scratch or you develop on your local machine first. I hope It was useful to you.