Support Online
Skip to main content

Ubuntu WordPress Installation: Step by Step Guide

Keyword: Ubuntu WordPress installation

What Will You Learn in This Guide?

In this guide, you will learn how to install WordPress on Ubuntu server.
We will create a fully compatible LAMP structure using Apache, MariaDB and PHP.
At the end of the installation, you will access the WordPress administration panel.

Why WordPress?

WordPress is used on more than 60% of sites worldwide.
It allows you to create a site without knowing code.
It stands out with its SEO compatible structure and plugin support.
Installation and management costs are low.


Step 1 – Update System and Install Apache

This step updates system packages and installs Apache.

apt update && apt upgrade

  1. Install Apache web server.

apt install apache2

  1. Check Apache service status.

systemctl status apache2

  1. Check from browser:

http://sunucu-ip

Step 2 – MariaDB Database Installation

  1. This step sets up the database that will hold WordPress data.

apt install mariadb-server mariadb-client

  1. Secure the database.

mysql_secure_installation

Recommended settings:

  1. Delete anonymous users

  2. Turn off remote root access

  3. Remove test database


Step 3 – PHP Installation

  1. This step installs PHP for WordPress to run.

apt install php php-mysql

  1. Check if PHP is running.

vim /var/www/html/info.php

  • File content:

<?php
phpinfo();
?>
  1. Check from browser:

http://sunucu-ip/info.php

-It is recommended to delete this file after installation.


Step 4 – Creating WordPress Database

  1. Log in to MariaDB.

mysql -u root -p

  1. Create database.

CREATE DATABASE wordpress_db;
  • Create user.


CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'guclu_sifre';

  1. Grant permissions.

GRANT ALL ON wordpress_db.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 5 – Installing WordPress Files

  1. Download WordPress files.

cd /tmp && wget https://wordpress.org/latest.tar.gz

  1. Unzip the archive.

tar -xvf latest.tar.gz
  1. Move to web directory.

cp -R wordpress /var/www/html/

  1. Set file ownerships.

chown -R www-data:www-data /var/www/html/wordpress
chmod -R 755 /var/www/html/wordpress
  1. Create the Uploads directory.

mkdir /var/www/html/wordpress/wp-content/uploads
chown -R www-data:www-data /var/www/html/wordpress/wp-content/uploads

Step 6 – Completing the Web Setup

  1. From the browser, go to:

http://sunucu-ip/wordpress
Veritabanı bilgilerini girin:

Veritabanı: wordpress_db

Kullanıcı: wp_user

Şifre: belirlediğiniz şifre

Sunucu: localhost

  1. Enter the site title and administrator information.
  • Complete the installation.

Frequently Asked Questions (FAQ)

1. Which Ubuntu versions are supported? 18.04, 20.04 and 22.04 LTS versions are eligible.

2. Can I use Nginx instead of Apache? Yes, but the configuration steps are different.

3. I can't upload files, why? It's usually caused by wp-content/uploads permissions.

4. How to add SSL? Let's Encrypt can be used with Certbot.

5. Is WordPress free? Yes, it is completely open source.


Result

WordPress has been successfully installed on Ubuntu. You can immediately improve your site with themes and plugins.

👉 You can launch WordPress in minutes with high-performance servers on the GenixNode platform.