To install WordPress with LAMP (Linux, Apache, MySQL, PHP) on Ubuntu 22.04, follow these steps:
Step 1 : Install LAMP Stack:
If you haven't installed the LAMP stack yet, please refer to the following post for a step-by-step guide: Ubuntu 22.04 Guides.
Step 2 : Create a Database for WordPress:
- Login to MySQL:
- Create a new database and user for WordPress:
Replace 'your_password'
with a strong password.
Step 3 : Download and Install WordPress to Custom Directory:
- Navigate to the Apache web root directory:
- Create a new directory for your WordPress installation:
- Navigate to the new directory:
- Download the latest WordPress release:
- Extract the downloaded file:
Move the WordPress files to the current directory:
- Set the correct permissions:
Step 4 : Configure Apache:
- Create a virtual host configuration file:
- Add the following content:
Replace your_domain_or_IP
with your domain name or server's IP address.
- Enable the virtual host and restart Apache:
Step 5 : Open your web browser and go to http://your_domain_or_IP
. Follow the on-screen instructions to complete the WordPress installation.
Step 6 : Choose your preferred language for the WordPress installation and click on the "Continue" button.
Step 7 : You will see a welcome message. Click on the "Let's go!" button to proceed.
Step 8 : Fill in the database connection details:
- Database Name: Enter the name of the database you created earlier (e.g., wordpress
).
- Username: Enter the database user you created (e.g., wordpress
).
- Password: Enter the password for the database user.
- Database Host: Leave it as localhost
.
- Table Prefix: You can leave it as the default wp_
or change it for security reasons.
Click on the "Submit" button.
Step 9 : If the database connection details are correct, you will see a screen confirming that WordPress can communicate with the database. Click on the "Run the installation" button.
Step 10 : Provide the basic information for your WordPress site:
- Site Title: Enter the title of your site.
- Username: Choose a username for the admin user.
- Password: Set a strong password for the admin user.
- Your Email: Enter your email address.
Click on the "Install WordPress" button.
Step 11 : If everything is successful, you will see a success message. Click on the "Log in" button to access the WordPress login page.
Step 12 : Log In to WordPress. Enter the username and password you created in the previous step and click on the "Log In" button.
Congratulations! You've successfully installed WordPress with LAMP on Ubuntu 22.04.