Support Online
Skip to main content

Installing WordPress on Ubuntu: Step by Step Guide with Apache

What Will You Learn in This Guide?

In this guide, you will learn how to install WordPress using Apache on a server with Ubuntu 14.04.
The goal is to create a stable and manageable WordPress infrastructure.

🧠 Technical Summary

Main Technical Topic:
WordPress installation with Ubuntu 14.04 + Apache + MySQL + PHP.

Solved Problem:
Establishing the basic infrastructure of a dynamic, content-managed website.

Steps Followed:

  • MySQL database and user creation
  • Download WordPress files
  • wp-config.php configuration
  • Set file permissions
  • Completing the installation via web interface
  • (Optional) SEO compatible permalinks

1️⃣ Prepare MySQL Database and User

WordPress stores all its data in the MySQL database.

mysql -u root -p
  • This command logs in with the MySQL administrator account.


CREATE DATABASE wordpress;
CREATE USER wp_kullanicisi@localhost IDENTIFIED BY 'guclu_sifre';
GRANT ALL PRIVILEGES ON wordpress.* TO wp_kullanicisi@localhost;
FLUSH PRIVILEGES;
exit;
  • These commands create a custom database and authorized user for WordPress.

2️⃣ Download WordPress Files


cd ~
wget http://wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz
  • These commands download and extract the latest WordPress files.


sudo apt-get update
sudo apt-get install php5-gd libssh2-php
  • These packages provide visual processing and secure plugin installation.

3️⃣ WordPress Configuration


cd ~/wordpress
cp wp-config-sample.php wp-config.php
  • This process creates the WordPress main configuration file.


curl -s https://api.wordpress.org/secret-key/1.1/salt/
  • This command generates secure keys for WordPress.


nano wp-config.php
  • This command opens the configuration file for editing.


define('DB_NAME', 'wordpress');
define('DB_USER', 'wp_kullanicisi');
define('DB_PASSWORD', 'guclu_sifre');
  • These lines allow WordPress to connect to the database.

4️⃣ Transfer Files to Web Directory


sudo rsync -avP ~/wordpress/ /var/www/html/
cd /var/www/html
sudo chown -R demo:www-data *
  • These commands copy files to the Apache root directory and set ownership.


mkdir wp-content/uploads
sudo chown -R :www-data /var/www/html/wp-content/uploads
  • This step prepares the necessary directory for media uploads.

5️⃣ Complete the Setup via Web Interface

1. Open your server address from the browser:


http://tr1-node01.ornek.com
  • This address starts the WordPress installation wizard.

  1. Enter the site title, administrator username and password.
  2. Complete the installation and log in to the panel.

1. Permalinks are important for SEO and readability.


sudo nano /etc/apache2/sites-available/000-default.conf
  • This command opens the Apache virtual host configuration.


<Directory /var/www/html/>
AllowOverride All
</Directory>
  • This setting allows the .htaccess file to work.


sudo a2enmod rewrite
sudo service apache2 restart
  • These commands activate the URL redirection module.

❓ Frequently Asked Questions (FAQ)

1. I'm getting a database connection error, why? Database information may not match wp-config.php.

2. The image is not uploading, what is the reason? The wp-content/uploads directory may not be writable.

3. Can I use another user instead of demo? Yes, you can type your own username in the chown command.


🎯 Result

Your WordPress site is now running stably on Ubuntu. The structure can be strengthened with SSL, security and performance settings. You can use this installation with peace of mind on the GenixNode infrastructure 🚀