This may be your first time creating a website, so you want to learn more by building the first version of it in localhost. Or you may be a pro that wants to build a demo version of a website and then upload it online when the time is right. Whatever category you fit, here we will explain in very simple words and detailed steps, the actions you need to take to create a website in your local machine.
Before starting with the really technical details I want to introduce the main work flow and some important concepts like WordPress, Hosting, Domains, DNS, MySQL, FTP, PHP:
There are three major phases of work-flow.
- Hosting – implies storing (a website or other data) on a server or other computers so that it can be accessed over the Internet browser. If the server is installed in your computer, you can access the site only on your computer’s browser. If the server is online, you can access the site (using a browser) from every where in the world. You just need internet connection.
- WordPress – It is the most popular Content System Management on the market that made possible the creation of 25% of the websites world wide. This platform is Open Source and has a great community. More info at WordPress.org
- Domain – is the website name that will be connected with your hosting account to serve your website.
- DNS – Domain Name Services this service make possible the translation of the domain address for example : codeless.co with to ip address 222.2333.44.55 of the respective host.
- MySQL – The major open source database software where all the content and data are stored when we use a dynamic website like WordPress.
- FTP – The file transport protocol, allows us to upload and download the website files from the hosting account.
- PHP – It’s a popular programming language used by WordPress.
There are some others keywords that we will use in these Web Series but this is a little introduction for those who are very new comers to the field.
So let create our first website.
The available local hosts are XAMPP and WAMP for Windows users or Mamp if on mac. Download and install one of these into your computer. (If you need help with the installation of the server, follow these useful links: xamp, wamp, mamp install tutorials)
In this tutorial we will be using XAMPP server.
Go to wordpress official site , download and unzip WordPress latest package version. This should be easy as the latest version is always the one available for download whenever you open this page.
Note: Please do not confuse WordPress.com with WordPress.org. The first one is an online platform owned by a third party that lets you upload your site online without any charge. But it has it’s limitations, such as restricted ftp access, limited amount of memory usage, limited rights on theme choice (you can only use the pre-defined wordpress themes but not premium themes) etc. While WordPress.org is the independent version that you can download and install into your host. Be it local host or online hosting provided by a hosting service. This is what we are downloading now. There are no limitations on it, except the fact that it’s not online. But you can use it to build your site before hand and then upload it online when you have finished the work and are confident about it. Or you can use it to create themes, plugins or test out things. You will have full access rights on files and folders, memory limit and database. Also you can try and install every premium theme available on the market.
Unzip the package you downloaded in the last step. You will find a “wordpress” folder in it. Copy this folder and paste it into xampp/htdocs folder in your computer.
*You can install XAMPP in any of the main computer directories. I prefer the D directory since it can be left untouched in case of a computer formatting. We wouldn’t want all that work to be lost, would we? Anyway, this is entirely on your preference so install XAMPP on C or D, wherever it’s more convenient for you.
In this article we installed XAMPP server in the D directory, so the main path will be: D:xampp
We added the unzipped WordPress files in this location: D:xampp\htdocs You can rename the “wordpress” folder as your site’s name for convenience or leave it as it is.
The website is composed of files and folders that are stored in the C:xampp\htdocs folder, and of a database that will store all the content (pages, posts, images, configurations, styling ..etc). Before starting the famous 5 minute install, it is needed to create a database. This is done in the phpMyAdmin. To go there paste this link into your browser: http://localhost/dashboard/
Click on phpMyAdmin menu. You will be directed into the database administration page. To go there directly, paste this link in your browser’s url: http://localhost/phpmyadmin/ Once here, go to the Database menu and in the field enter the new database name. Click on “Create” button to finally add it. Once created it will be listed in the left side of the panel. We have now a new empty database.
By default the database root user is “root” and there is no password to protect it. Changing it requires additional steps that will be covered in another article.
Since we have now the wordpress files and the database where to install it, let’s proceed with WordPress famous 5 minutes installation. Go to http://localhost/wordpress where “wordpress” is the name of the folder we added in htdocs folder in step 3. If you have renamed it, then the path would be: http://localhost/your-wp-folder-new-name
After clicking ‘enter’ from the keyboard, you will be redirected to the configuration panel.
Read some useful information in the next step and click “Let’s Go” to finish the installation when you are ready.
In the next step, we setup the database credentials that the installation will use to connect the site with the right database.
Enter here the name of the database you just created. The username which by default is “root” and the password which is left empty by default. As stated before to change these values there are other steps to perform. You need a bit more understanding of how local host work to configure it. But for an simple installation this is more than enough.
Then you have the database host, that in this case is localhost. Last is the prefix that will be used when creating the database tables. The default value is “wp_“. Change it to your wish if you want another more representative prefix.
Click on ‘Submit’ to enter the variables. Next step is to run the install.
One more form to fill and you are almost over. Now it’s time to give some information like the name for your new site, the admin’s username, password and email. If the database credentials are defined by the server and you need additional steps to change them, the site’s title/username/password are entirely up to you. You can chose the credentials you want. Make sure to save them somewhere in your computer in order not the forget them because you will use this username and password to access wordpress dashboard from now on.
Click on “Install WordPress” and your work is over. Now let wordpress do the job.
After this you will be redirected to http://localhost/wordpress/wp-login.php Enter the username and password set up in the last step and login into the installation.
That’s all regarding the installation of WordPress in a localhost.
This tutorial covered the first two major steps of the work-flow we discussed in the beginning of the article. Server installation and wordpress installation. Now it begins the New Website Configuration and Set Up. This is the third and last step, theme installation. We are going to keep talking about those on the other tutorials after this. Stay tuned!
Hope you enjoyed 🙂 !