How to Install WordPress on Ubuntu Using the Command Line

  • March 13, 2025
  • 0 Comments

Want to set up WordPress on your own Ubuntu server? Using the command line might seem tricky, but it's actually a cool way to get it done! Let's walk through the steps.

What You'll Need:

  • An Ubuntu server (like one from Hostaira!)
  • SSH access to your server
  • A little bit of patience!

 

Step 1: Update Your Server

First, let's make sure your server is up-to-date. Open your terminal and type:

<code>sudo apt update && sudo apt upgrade -y</code>

This command updates the list of available software and then installs any updates. Type in your server password when asked.


Step 2: Install Apache, MySQL, and PHP

WordPress needs these three things to run. Type:

<code>sudo apt install apache2 mariadb-server php libapache2-mod-php php-mysql -y</code>

Apache is the web server, MySQL (or MariaDB) is the database, and PHP is the programming language.


Step 3: Create a Database

Now, let's make a database for WordPress. Type:

<code>sudo mysql -u root -p</code>

Enter your MySQL root password. Then, type these commands, pressing Enter after each one:

<code>CREATE DATABASE wordpress;
CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;</code>
1   1. community.noez.de community.noez.de

Replace your_password with a strong password!


Step 4: Download WordPress

Let's download the WordPress files. Type:

<code>wget https://wordpress.org/latest.tar.gz</code>

Then, unzip the files:

<code>tar -xzvf latest.tar.gz</code>

Step 5: Move WordPress Files

Move the WordPress files to your website's folder. Type:

<code>sudo mv wordpress/* /var/www/html/</code>

Step 6: Configure WordPress

Go to your website in your browser (like http://your_server_ip). You'll see the WordPress installation screen. Follow the instructions to connect to your database.


Important Tips:

  • Be careful when typing commands!
  • Always use strong passwords.
  • If you have any questions, Hostaira support is ready to help! Just click here to submit a ticket.

 

That's it! You've installed WordPress on your Ubuntu server. Hostaira also offers great WordPress hosting plans too! You can check them out here.

How helpful was this article to you?

Posting has been disabled.