Skip to content
Step by Step Internet 馃寪 Guides for learning to surf the Net

How to install WordPress on Linux to create your first website with this CMS? Step by step guide

Over 60 million people use WordPress as their preferred blogging platform, sales pages and official brand sites. Although Windows It is the most used operating system in the world, developers prefer to manage a website with this CMS from Linux.

WordPress can be installed on any Linux distribution, which is a great advantage because there is enough variety of distributions.

In this article, we will show you step by step the resources that are needed to install WordPress on any Linux system. What’s more, you will have a guide on how to perform a clean install, that adjusts to the characteristics of the distribution of your preference.

What are the benefits of using WordPress to create your first website?

WordPress interface

If it is one of the most popular content managers, it is because it has good support, is reliable and completely safe, although this last quality depends on your ability as a developer.

Check out the benefits of working with this option:

  • Is free: Like Linux distributions, most of its features are freely accessible to users. You can create an amazing website at no cost.
  • It is “open source”: WordPress was created by a group of people who chose to leave their idea open source, so more developers can add great features to the existing foundation.
  • It has thousands of plugins: This is a contribution from the developer community that it has. There are solutions for all kinds of problems and connection support on all social networks and platforms.
  • Has full assistance: If you are an experienced developer or if you are simply a Blogger, WordPress adjusts to the needs of anyone. Provides free support to people who require it.
  • Facilitates SEO: positioning a page is not an easy task. However, WordPress has tools that make this work less traumatic for developers and writers. You must let see all the SEO and readability fields when writing.
  • It has templates: This is another way to make life easier for newbies who just want to have a personal blog. It is a way of encouraging people to stay in your service.
  • Payment plans: they also cater to individuals and brands who want personalized support. As not everything should be free, those attached to this service have preferences in terms of technical assistance and strategy advice.

Learn step by step how to install WordPress on Linux without errors like an expert

Nginx interfaces

Yes WordPress caught your attention then you must learn how to do a correct installation on any Linux distribution.

We will do this process in Ubuntu.

Install Nginx

The first thing to do is update Ubuntu, this is how they are avoided compatibility errors.

When this and other operating systems are out of date, it is likely that WordPress cannot meet your expectations and it will be scrapped:

  • Open the terminal and type the command: sudo apt-get upgrade -y.

When the process is finished, go to install Nginx on Ubuntu, this is a web server and it works as a proxy.

So you should know these terms well when you try to install on your own, because you should read more about these services:

  • Write the command: sudo apt-get install nginx -y.

Install MariaDB

This is a good system that manages databases and every WordPress website must have a.

MariaDB also works with other content managers that, later, you will see a list of the most popular alternatives:

  • Run the command: sudo apt-get install mariadb-server -y.
  • mysql_secure_installation. With this I know start tuning the database manager.
  • When necessary, write a password that you cannot forget.

Create a database

Every website requires a database, even a blog, so you should pay special attention to this step to ensure that there is a smooth operation of any CMS (Content Management System).

To make this adjustment, you must have the created password at hand. If you don’t change the password, you can type the command:

  • mysql -u root -p

If you want to change the credentials, you just have to put the user after “-u” and the new password after “-p”, you can write the following commands:

  • CREATE DATABASE wordpress;
  • CREATE USER `tu-usuario`@`localhost` IDENTIFIED BY 'tucontraseña';
  • GRANT ALL ON wordpress.* TO `wpuser`@`localhost`;
  • FLUSH PRIVILEGES;
  • exit;

Surely he will ask you at some point to enter your new username and password.

Install PHP

This is a programming language and open source which has become quite common among developers. To install it, you must type the following commands.

Do not forget to do exactly what we ask you in this section:

  • sudo apt-get install php-fpm php-curl php-mysql php-gd php-mbstring php-xml php-xmlrpc -y
  • sudo nano /etc/php/7.2/fpm/php.ini

It is important that you look for this command line: “; Cgi.fix_pathinfo = 1”. So you can substitute the value “1” for the value “0”.

You must also substitute other values, and they should be as follows, find and substitute:

  • upload_max_filesize = 100M
  • post_max_size = 1000M
  • memory_limit = 1000M
  • max_execution_time = 120

Download WordPress

To do this download, command lines are also required that you must put in the terminal.

Thanks to Linux, the whole process is done in this way:

  • cd /var/www/html
  • wget https://wordpress.org/latest.tar.gz
  • tar -zxvf latest.tar.gz --strip-components=1

Now, some permissions must be changed on the Nginx folder, so that they are read and write at the same time:

  • chown -R www-data:www-data /var/www/html/
  • chmod -R 755

Time to create a new file with the commands:

  • nano /etc/nginx/sites-available/example.com
  • ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/. This command serves to enable.

Finally, in this step you must restart both Nginx and PHP:

  • sudo systemctl restart nginx.service
  • sudo systemctl restart php7.2-fpm.service

Final configuration

You must put some credentials to correctly edit the WordPress configuration file:

  • mv /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
  • sudo nano /var/www/html/wp-config.php

Important information must also be changed:

  • define('DB_NAME', 'wordpress');
  • define('DB_USER', 'usuario-de-la-base-de-datos');
  • define('DB_PASSWORD', 'contraseña-de-la-base-de-datos');

At another time, the suggestion is to change the credentials, but for now you can manage your first web page with these settings. To see the web as such, you must put the IP address of your computer in the address bar or you can place /var/www/html/. You already have configured WordPress and you can start creating web pages for your site to grow.

List of the best alternative CMS to WordPress that you can use to create your first website

Ionos interfaces

Besides WordPress, there are other content managers that you can use and install in your distribution Linux. Each of them has different steps and you should do your research on this before trying to install them.

The correct choice will depend on the requirements you have, the experience you show to program and the patience you may have when dedicating time and resources to this project:

IONOS MyWebsite

It has more than 400 templates and is based on satisfying users who have basic and intermediate knowledge in managing web pages. It began to be developed in 2014 and supports all the programming languages ​​known to date.

It is usually preferred for large companies looking for privacy and a not so common manager with which they can better adjust their security and protect their databases:

  • All its modalities add a personalized mail service.
  • All functions are free.
  • They also have payment plans, with 24/7 assistance.

Ghost

It has a minimum number of users, only 1.5 million, but they are adept at the functionalities of this content manager. It is designed to be used by end users, so it involves a series of limitations if you are a developer and want to experiment with your website.

It is oriented more in the publication of texts and images, it is ideal for writing projects, which seems to be more a blog platform than professional pages of any kind:

  • It is a manager for beginners and blogs.
  • Automatically, it is optimized for SEO content creation.
  • The downside is that there are not many plugins for customizing or adding features.

Anchor CMS

This is a lightweight alternative and as professional as WordPress, then works with the PHP language, which requires that it be installed in a server environment that supports PHP 5.6+ and MySQL 5.6+. If these are unfamiliar terms for you, then it is not the best CMS you can start with. You have several copywriting options, conforms to the style of conventional blogs and specialized sales websites.

With this option you can have access to templates and customize them, changes are also added with different functions and it is licensed under GNU:

  • You can only use it with updated browsers. Exclude Internet Explorer.
  • Provides support for professional web and blogging.
  • It is completely free.
  • There are fewer plugins, compared to others.