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
- Install Apache web server.
apt install apache2
- Check Apache service status.
systemctl status apache2
- Check from browser:
http://sunucu-ip
Step 2 – MariaDB Database Installation
- This step sets up the database that will hold WordPress data.
apt install mariadb-server mariadb-client
- Secure the database.
mysql_secure_installation
Recommended settings:
-
Delete anonymous users
-
Turn off remote root access
-
Remove test database
Step 3 – PHP Installation
- This step installs PHP for WordPress to run.
apt install php php-mysql
- Check if PHP is running.
vim /var/www/html/info.php
- File content:
<?php
phpinfo();
?>
- Check from browser:
http://sunucu-ip/info.php
-It is recommended to delete this file after installation.
Step 4 – Creating WordPress Database
- Log in to MariaDB.
mysql -u root -p
- Create database.
CREATE DATABASE wordpress_db;
- Create user.
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'guclu_sifre';
- Grant permissions.
GRANT ALL ON wordpress_db.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 5 – Installing WordPress Files
- Download WordPress files.
cd /tmp && wget https://wordpress.org/latest.tar.gz
- Unzip the archive.
tar -xvf latest.tar.gz
- Move to web directory.
cp -R wordpress /var/www/html/
- Set file ownerships.
chown -R www-data:www-data /var/www/html/wordpress
chmod -R 755 /var/www/html/wordpress
- 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
- 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
- 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.

