
WordPress is a free, popular open-source content management system (CMS) used to build dynamic websites, blogs, and online stores. It is powered by PHP and uses a MySQL or MariaDB database for content storage. With its intuitive admin dashboard, WordPress allows users to manage posts, pages, themes, plugins, and users without writing any code.
In this article, you'll install WordPress on a Debian 12 server using the LEMP stack (Linux, Nginx, MariaDB, PHP). You'll configure a virtual host, secure your site with HTTPS using Let's Encrypt, and set up WordPress through its web-based installer to access the admin dashboard.
Before you begin, you need to:
sudo privileges.www.example.com.WordPress requires a web server stack like LAMP (Linux, Apache, MariaDB, PHP) or LEMP (Linux, Nginx, MariaDB, PHP). This article uses the LEMP stack, but you can follow a different configuration if preferred.
To install the LEMP stack on Debian 12, follow the How to Install Nginx, MySQL, PHP (LEMP Stack) on Debian 12 article.
If you prefer to use the LAMP stack, refer to the How to Install Apache, MySQL, PHP (LAMP Stack) on Debian 12 article instead.
WordPress uses a database to store content such as posts, user accounts, settings, and plugin data. You need to create a database and a user account before launching the application.
Follow these steps to create a database using the default MariaDB server installed earlier:
Log in to the database server.
Create a new database for WordPress.
Create a new user with a strong password.
Replace StrongPassword with your own secure password.
Grant the user full privileges on the WordPress database.
Apply the permission changes.
Exit the database console.
You can download the latest WordPress release directly from the official website and extract its contents into a custom webroot directory. This section guides you through setting up the WordPress files for deployment.
Navigate to your user's home directory.
Download the latest WordPress archive.
Extract the archive.
Confirm that the wordpress directory was extracted.
Output:
Create a new web root directory for your WordPress site.
Move the WordPress files to the web root directory.
Verify that the files are present.
Set the correct ownership for the web root directory.
Set directory permissions to 755.
Set file permissions to 644.
Confirm the updated permissions.
To serve your WordPress site using Nginx, create a virtual host configuration that defines the domain, webroot, and PHP processing settings.
Navigate to the Nginx virtual host configuration directory.
Create a new virtual host file for your domain.
Add the following configuration to the file.
Replace www.example.com with your actual domain.
This configuration:
www.example.com./var/www/www.example.com..php requests to the PHP-FPM socket for processing.Save and close the file.
Enable the virtual host by creating a symbolic link.
Remove the default Nginx configuration to avoid conflicts.
Test the Nginx configuration for syntax errors.
Output:
If errors occur, review the configuration file and fix any issues.
Reload Nginx to apply the changes.
By default, the Nginx virtual host configuration for WordPress listens on port 80 (HTTP), which is unencrypted and insecure. To enable secure HTTPS access, generate SSL certificates using Let's Encrypt and configure Nginx to handle encrypted traffic.
Update the APT package index.
Install Certbot and its Nginx plugin.
Generate and install a free SSL certificate for your domain.
Replace wpadmin@example.com with your email address.
Certbot will automatically update your Nginx configuration and reload the service.
Test the automatic renewal process.
Allow HTTPS traffic through the firewall.
Reload UFW to apply the rule changes.
Use the web interface to configure WordPress, connect the database, and create your admin account.
Visit your domain in a web browser to launch the WordPress setup wizard.
Click Let's Go.
Enter the database name, username, and password you created earlier.
Click Run the Installation to initialize the WordPress database.
Enter your site title, admin username, password, and email.
Optionally enable Search Engine Visibility to discourage your site from indexing.
Click Install WordPress.
After installation, click Login to access the WordPress admin dashboard.
After installing WordPress, follow these steps to log in and begin managing your website.
Open the WordPress login page by visiting your domain with the /wp-admin path.
Log in using your administrator credentials. The WordPress dashboard should load correctly, allowing you to manage themes, plugins, users, and other settings.
Navigate to Users to add new users and assign roles.
Click Appearance > Themes to install or activate themes.
Click Plugins to add, remove, or configure WordPress plugins.
Click Pages to manage site content and layout.
Click Posts to view and edit blog entries.
Click Add Post to create a new blog post.
Set the post title as Hello World! Greetings from Vultr, and enter WordPress is installed in the content block.
Click Publish to make the post live.
Click View Post to confirm it appears correctly on your site.
In this article, you installed and configured WordPress on a Debian 12 server using a LEMP stack. You learned how to create a database, configure Nginx, secure the installation with SSL, and complete the WordPress setup via the web interface. WordPress enables you to build dynamic websites, from blogs and forums to online stores. For better scalability and performance, consider integrating a CDN, caching plugins, and security best practices. For advanced customization and management tips, refer to the official WordPress documentation.
0 Comments
Be the first to comment and share your perspective with the community.