Are you looking to create a powerful and engaging website without the need for coding skills? Look no further than WordPress, one of the most popular website-building tools available today. With WordPress, you can easily share and build your story on the internet with a simple and effective platform. In this tutorial, we will guide you through the step-by-step process of installing WordPress with a LAMP Stack on your Debian 12 server. So, let’s get started!
Prerequisites
Before we begin, make sure you have root access to your Debian 12 server and have the LAMP Stack installed and running. If you haven’t set up the LAMP Stack yet, don’t worry! You can follow our tutorial on how to setup LAMP Stack on Debian 12 to get everything up and running smoothly.
Creating the Database
The first step in installing WordPress is to create a database where all the information will be stored. To do this, log in to MariaDB as the root user by running the following command in your terminal:
mysql -u root -p
Enter your root password when prompted. Once you’re logged in, create your WordPress database. In this example, we’ll name it wp_database
, but feel free to choose a name that suits your website. Run the following command:
CREATE DATABASE wp_database;
You should see a message confirming the successful creation of the database.
Next, let’s create a regular user for WordPress. Run the following command, replacing StrongPassword
with a strong password of your choice:
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'StrongPassword';
Make sure to choose a secure password to protect your database.
Finally, grant the new user all the privileges for the database wp_database
. Run the following command:
GRANT ALL ON `wp_database`.* TO `wpuser`@`localhost`;
This will give the user wpuser
full access to the wp_database
database.
Once you’ve granted the privileges, flush the privileges and exit MariaDB by running the following commands:
FLUSH PRIVILEGES; EXIT;
Downloading and Unzipping WordPress
Now that we have our database set up, let’s download and unzip the latest version of WordPress. Start by navigating to the official WordPress website to find the latest version available for download. Alternatively, you can use the following command to download the latest version directly from the terminal:
cd /tmp wget https://wordpress.org/latest.tar.gz
Once the download is complete, unzip the WordPress file by running the following command:
tar xpf latest.tar.gz
This will create a folder called wordpress
containing the entire WordPress installation. You can copy this folder to your desired location. In this example, we’ll copy it to /var/www/wordpress
by running the following command:
mkdir /var/www/wordpress cp -R wordpress/* /var/www/wordpress/
Feel free to choose a different directory name or location based on your preferences.
Setting Up an Apache vHost
To configure Apache to serve your WordPress website, we need to create a virtual host. Using your favorite text editor, create a configuration file in /etc/apache2/sites-available
with a .conf
file extension. For example, we’ll use wordpress.conf
in this tutorial:
nano /etc/apache2/sites-available/wordpress.conf
In the configuration file, add the following contents:
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
ServerAdmin webmaster@example.com
DocumentRoot /var/www/wordpress
<Directory /var/www/wordpress>
Options -Indexes +FollowSymLinks
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/wordpress-error.log
CustomLog ${APACHE_LOG_DIR}/wordpress-access.log combined
</VirtualHost>
Replace example.com
with your actual domain name. This configuration defines the server name, document root, and directory settings for your WordPress site.
Next, create a symbolic link to make the configuration file available in the sites-enabled
directory by running the following command:
ln -s /etc/apache2/sites-available/wordpress.conf /etc/apache2/sites-enabled/
This enables the new configuration.
To ensure that there are no syntax errors in your configuration, run the following command:
apachectl configtest
If you see Syntax OK
, restart the Apache web server to apply the changes by running the following command:
systemctl restart apache2
Installing WordPress
With the server and database set up, it’s time to install WordPress. Open a web browser and navigate to your domain name, such as http://example.com
. You should see the WordPress installation page.
Click on the “Run the installation” button to begin the installation process. Provide the requested information, including your website’s title, username, password, and email address. Make sure to choose a strong password to secure your WordPress admin account.
Once you’ve filled in all the necessary details, click on the “Install WordPress” button. WordPress will then set up your website and display a success message once the installation is complete.
Logging in to WordPress
Congratulations! You’ve successfully installed WordPress on your Debian 12 server. To access the WordPress admin dashboard, click on the “Log In” button. Enter the username and password you set during the installation process.
Once logged in, you can start customizing your website, installing themes and plugins, and creating engaging content to share with your audience.
Conclusion
In this tutorial, we walked you through the step-by-step process of installing WordPress with a LAMP Stack on your Debian 12 server. By following these instructions, you can create a powerful and engaging website without the need for coding skills. WordPress offers a user-friendly interface and a wide range of customization options, making it an ideal choice for individuals and businesses alike.
Remember, if you’re looking for reliable and scalable cloud hosting solutions, Shape.host offers Linux SSD VPS services that can meet your needs. With Shape.host, you can enjoy the benefits of fast and secure hosting, ensuring your WordPress website performs at its best.
So, what are you waiting for? Start your WordPress journey today and build a stunning website that represents your brand and engages your audience.