To install WordPress on Ubuntu using the terminal, you can follow these steps. This guide assumes you have a LAMP (Linux, Apache, MySQL, PHP) stack already set up on your Ubuntu server. If not, you'll need to set up the LAMP stack first.
Here's how you can install WordPress:
- Update and Upgrade Packages: Open a terminal and update the package list and upgrade existing packages:
sudo apt update
sudo apt upgrade
- Install Additional Packages: Install the required packages for WordPress:
sudo apt install php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip
- Create a MySQL Database and User: Log into MySQL and create a database and user for WordPress:
sudo mysql
CREATE DATABASE wordpress;
CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
-
Download and Configure WordPress:
Navigate to your web server's root directory (usually
/var/www/html
):
cd /var/www/html
Download the latest WordPress package:
sudo wget https://wordpress.org/latest.tar.gz
Extract the archive:
sudo tar -xzvf latest.tar.gz
Rename the WordPress directory:
sudo mv wordpress your-site-name
Set ownership and permissions:
sudo chown -R www-data:www-data your-site-name
sudo chmod -R 755 your-site-name
- Configure WordPress: Copy the sample configuration file:
cd your-site-name
sudo cp wp-config-sample.php wp-config.php
Edit the configuration file:
sudo nano wp-config.php
Set the database details you created earlier:
define('DB_NAME', 'wordpress');
define('DB_USER', 'wordpressuser');
define('DB_PASSWORD', 'password');
Save and close the file (Ctrl+O
to save, Ctrl+X
to exit).
-
Access WordPress Installation:
Open a web browser and navigate to your server's IP address or domain followed by
/your-site-name
(e.g.,http://your_server_ip/your-site-name
).
Follow the WordPress installation wizard to complete the setup.
Complete the Installation:
Provide the site title, admin username, password, and email address.Access the WordPress Admin Dashboard:
Once the installation is complete, you can access the WordPress admin dashboard by going tohttp://your_server_ip/your-site-name/wp-admin
.
That's it! You've successfully installed WordPress on your Ubuntu server using the terminal. Remember to configure any additional settings and security measures as needed.
Top comments (0)