A tutorial on setting up a WordPress website on an Ubuntu server

Install WordPress on Ubuntu; WordPress is one of the most popular content management systems (CMS) in the world. Millions of websites use this tool because it is the most convenient tool for ordinary users who are not very good at web programming. Today we will start and configure Ubuntu server to install WordPress on it.

Create a server

The fastest way to have a server is to buy a VPS. VPS is a VMWare-based virtual server that allows you to create a server in no time.
Now go to the Parspack.com website and register there. In the next step, select the operating system you want, this tutorial will use the Ubuntu 20.04 x64 operating system. Then choose the location of the server, if you want to develop the site for European customers, the German data center is a good option. For Iranian customers and users, virtual servers in Iran are the best option.

Then select the server configuration. For the test site we will use a virtual server with 2 processors, 4 GB RAM, 60 GB hard drive and an Internet connection speed of 50 Mbps. This configuration will be enough for about 50,000 users a day, which is an almost unattainable dream for a new website in the first few months. If the number of users increases, you can easily add resources to your server. VPS with these specifications is very suitable in the initial stage.

In the server configuration and access type, select a password login and log in to the PuTTY server.

Setting up an Ubuntu server

Before installing WordPress, you need to install some server software packages – Apache web server and MySQL database, as well as PHP. But before that, we need to update our operating system:

sudo apt-get update && sudo apt-get upgrade -y

Install Apache Web Server on Ubuntu Server

To install the latest version of the Apache web server, enter the following commands:

sudo apt install apache2 apache2-utils

Then add Apache for automatic startup and startup:

sudo systemctl enable apache2
sudo systemctl start apache2

To check if Apache is available online, enter the IP address of your server in your browser. If you are installing a web server on a local machine, use or http: // localhost.

Install wordpress on Ubuntu

Tutorial for installing WordPress script on Ubuntu server

By default, all HTML documents are in the / var / www / html directory. We also need the Apache mod_rewrite module to make WordPress work properly. To activate it, run the following command:

sudo a2enmod rewrite

Then restart the web server with the following command:

sudo systemctl restart apache2

Install MySQL database on Ubuntu server

To install mysql db, run the following command:

sudo apt install mysql-client mysql-server

Run the following command to complete the settings:

sudo mysql_secure_installation

The system asks you to install a password verification plugin that prohibits the use of weak passwords:

Install mysql on ubuntu

Learn the steps to install mysql on an Ubuntu server

Then you need to change the password and disable access to the superuser account from the network, as well as disable guest access. We answer all questions.

Install PHP on Ubuntu Server

Before installing WordPress on Ubuntu 20.04, you need to install PHP and several other modules to work with the MySQL web server and database. To do this, run the following command:

sudo apt install php7.4 php7.4-mysql libapache2-mod-php7.4 php7.4-cli php7.4-cgi php7.4-gd

To test how PHP works, create a file called test.php in / var / www / html /:

sudo nano /var/www/html/test.php

text file:


Save it and then open http: //ip-address/test.php in a web browser. If everything is set up correctly, you will see a page with information about the PHP version. Naturally, it must be removed after successful testing.

Install WordPress on the Ubuntu server

Finally, download the latest version of WordPress CMS from the official website:

wget -c http://wordpress.org/latest.tar.gz

Extract the contents of the archive to your current folder:

tar -xzvf latest.tar.gz

Copy WordPress files from your current folder to / var / www / html /:

sudo rsync -av wordpress/* /var/www/html/

In order for the web server to work properly with these files, you need to set the correct permissions for them, ie. user and group www-data:

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

And now the installation of WordPress on Ubuntu 20.04 is complete, but the configuration of the connection to the database still remains. To make WordPress open by default, delete the index.html file:

sudo rm /var/www/html/index.html

Create a database for the new website

To create a database, first log in to the mysql management interface. To do this, run the following command:

sudo mysql -u root -p
sudo mysql -u root -p

Enter the password you entered during the installation, then run the following commands separately to create the database and the user and set the correct access for them:

mysql> CREATE DATABASE wp_db;
mysql> CREATE USER 'wpusr'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON wp_db.* TO 'wpusr'@'localhost';
mysql> EXIT;

Replace wp_db with the desired database name, wpusr with the user name, and the password with the desired password. localhost means that you can only connect to the database from a local machine such as your laptop.

Configure WordPress on an Ubuntu server

Everything is ready to configure WordPress. Enter the IP address of the server where you installed WordPress. If the platform is installed on a local computer, enter LocalHost. In the first window, the program will ask you to select a language. Then click Next and enter the database name, username and password you used to create the db.

Finally, just choose a website name, administrator login and complex password.

Configure WordPress on an ubuntu server

Learn how to install and configure wordpress on an ubuntu server

All you have to do is log in. You can also use the WordPress content management system you just launched.

Start and configure WordPress on Linux

Run WordPress on an Ubuntu Linux server

You can now easily create your own website using a number of templates, plugins and a graphical interface. From now on you can have a lot of fun with your website!

last word

Install WordPress on Ubuntu Server; If you want to manage your website on a Linux server (VPS or dedicated server), this article fully describes how to implement a WordPress website in an Ubuntu Linux distribution. Just consider the prerequisites and proceed according to the training.

Frequently Asked Questions

1. Can WordPress be hosted on Ubuntu?

Most of the time, Linux will be the default server operating system for your WordPress site. Ubuntu is an established system that has earned a high reputation in the world of web hosting. Also compatible with Sipanel.

2. Which Linux is better for WordPress?

Ubuntu is one of the best operating systems to run your WordPress site.

3. Which test is not supported by JMeter?

Jmeter does not support the actual behavior of the browser, as it does not present HTML web pages as a normal browser. So the answer can be seen in HTML format, but there is no real time in the generated samples.

{“@context”: “https://schema.org”, “@type”: “FAQPage”, “mainEntity”: [{
“@type”: “Question”,
“name”: “آیا می‌توان وردپرس را روی اوبونتو میزبانی کرد؟”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “بیشتر اوقات، لینوکس سیستم عامل پیش فرض سرور برای سایت وردپرس شما خواهد بود. اوبونتو یک سیستم جا افتاده است که شهرت بالایی در دنیای میزبانی وب به دست آورده است. همچنین با سی‌پنل سازگار است.”
“@type”: “Question”,
“name”: “کدام لینوکس برای وردپرس بهتر است؟”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “اوبونتو یکی از بهترین سیستم‌عامل‌ها برای اجرای سایت وردپرس شماست.”
“@type”: “Question”,
“name”: “کدام تست توسط JMeter پشتیبانی نمی شود؟”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “Jmeter از رفتار واقعی مرورگر پشتیبانی نمی کند زیرا صفحات وب HTML را به عنوان مرورگر معمولی ارائه نمی کند. به طوری که پاسخ را می توان در قالب HTML مشاهده کرد اما زمان بندی واقعی در نمونه های تولید شده وجود ندارد.”

Posted in How to set up a WordPress website on an Ubuntu server for the first time in Parsupak. appear.

Leave Your Comment

Your email address will not be published.

Supportscreen tag