Overview
Installing WordPress manually, step by step, gives you complete control over the process, from database setup to file permissions, ensuring a secure and optimized foundation for your website. This guide walks you through the entire process on a fresh Linux server with a LAMP (Linux, Apache, MySQL, PHP) stack. You will learn to create a dedicated database, upload and configure WordPress files, run the famous five-minute install, and apply critical post-installation security measures. This method is ideal for developers, system administrators, or any site owner who wants to understand every component of their WordPress environment.
Why Choose a Manual Installation Over Automated Scripts?
Manual installation is preferred when you need granular control, are working on a custom server configuration, or wish to avoid the potential bloat of automated installers. It ensures you know exactly what software is installed and how it's configured. For those managing their own servers or VPS, this knowledge is invaluable for debugging and performance tuning. While many hosting providers offer one-click installers or pre-configured marketplace solutions, a manual install is a foundational skill.
The choice often comes down to control versus convenience.
| Installation Method | Key Advantages | Best For |
|---|---|---|
| Manual Install | Full control over every component; minimal software footprint; deep understanding of server environment. | Developers, system administrators, custom server setups, learning environments. |
| One-Click / Marketplace | Speed and simplicity; often includes automatic updates and pre-configured settings. | Beginners, rapid deployment, non-technical users, shared hosting environments. |
Prerequisites and Server Preparation Checklist
Before touching WordPress, your server must meet specific technical requirements. This checklist ensures you have a clean, compatible environment. If you are starting from scratch, you will need to install a LAMP stack on your Linux server.
- Operating System: A supported Linux distribution (e.g., Ubuntu 20.04+, Debian 11+, CentOS 7+).
- Web Server: Apache installed and running with
mod_rewriteenabled. - Database: MySQL 5.7+ or MariaDB 10.3+ installed and running.
- PHP: Version 7.4 or higher installed with required extensions (
php-mysql,php-gd,php-mbstring,php-curl,php-zip). - Network: A static public IP address and a domain name with DNS records pointing to your server.
- Access: SSH terminal access or a web-based file manager to manage files.
- Database Credentials: A prepared database name, username, and strong password.
Step 1: Create a Dedicated MySQL Database and User
WordPress stores all its content—posts, pages, comments, and settings—in a database. You must create a dedicated database and a restricted user for WordPress to use. This enhances security by isolating WordPress data.
First, log into your MySQL or MariaDB server as the root user:
mysql -u root -p
Enter your root password when prompted. Then, execute the following SQL commands, replacing the placeholder values with your own desired names and a strong, unique password.
CREATE DATABASE wordpress_db;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'YourStrongPassword123!';
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Record these credentials securely. You will need them in the next steps.
| Credential | Your Value (Example) |
|---|---|
| Database Name | wordpress_db |
| Database User | wp_user |
| Database Password | YourStrongPassword123! |
| Database Host | localhost |
Step 2: Download and Place WordPress Files
With the database ready, download the latest WordPress core files and place them in your web server's public directory.
Navigate to your Apache document root, typically /var/www/html:
cd /var/www/html
Download the latest WordPress tarball from the official repository:
sudo wget
Extract the archive:
sudo tar -xzvf latest.tar.gz
This creates a wordpress folder. You can safely remove the downloaded archive:
sudo rm latest.tar.gz
Step 3: Configure File Permissions and Ownership
The web server needs to read, write, and execute certain files. Proper permissions are critical for security and functionality. For Apache on Debian/Ubuntu systems, the web server user is typically www-data.
Set the correct ownership for all WordPress files and directories:
sudo chown -R www-data:www-data /var/www/html/wordpress
Next, apply secure directory and file permissions. Directories should be 755 (owner can read/write/execute, others can read/execute), and files should be 644 (owner can read/write, others can read).
sudo find /var/www/html/wordpress -type d -exec chmod 755 {} \;
sudo find /var/www/html/wordpress -type f -exec chmod 644 {} \;
Step 4: Create and Edit the wp-config.php File
This file is the main configuration hub for your WordPress site, telling it how to connect to the database.
First, create the file by copying the sample configuration:
cd /var/www/html/wordpress
sudo cp wp-config-sample.php wp-config.php
Now, edit this new file with a text editor like nano or vim:
sudo nano wp-config.php
Locate the database settings section and replace the placeholder values with the credentials you created in Step 1.
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress_db' );
/** Database username */
define( 'DB_USER', 'wp_user' );
/** Database password */
define( 'DB_PASSWORD', 'YourStrongPassword123!' );
/** Database hostname */
define( 'DB_HOST', 'localhost' );
Save the file and exit the editor. In nano, press Ctrl+X, then Y, then Enter.
Step 5: Run the WordPress Web Installer
With server-side setup complete, you now finish the installation through your web browser.
- Open your browser and navigate to your domain or IP address followed by
/wordpress. Example:or. - Language Selection: Choose your preferred language and click Continue.
- Site Information: Enter your desired Site Title, Username (avoid "admin" for security), Password, and Email Address.
- Search Engine Visibility: Decide whether to discourage search engines from indexing the site during construction. Leave this unchecked for a live site you want to be found.
- Install: Click Install WordPress.
Upon success, you will see a confirmation screen. Click Log In to access your new WordPress dashboard.
Step 6: Essential Post-Installation Security Hardening
Your site is live, but these final steps are crucial for a secure setup.
- Update Permalinks: Go to Settings > Permalinks in your dashboard and select a search-engine-friendly structure like "Post name." This requires
mod_rewriteto be active in Apache. - Enable HTTPS: Secure your site with an SSL certificate. You can use a free certificate from Let's Encrypt. After installation, force all traffic to HTTPS via a plugin or by editing your
.htaccessfile. - Delete Unused Content: Remove any default posts, pages, and themes you will not use to minimize attack surface.
- Set Up Regular Backups: Implement a reliable backup solution from day one.
Pre-Launch Technical Checklist
Run through this final verification before promoting your site.
- Database Connection: WordPress can access the database with the credentials in
wp-config.php(no "Error establishing database connection"). - File Permissions: Web server user (
www-data) owns all files in the/wordpressdirectory. - Clean Installation: No leftover
readme.htmlor license files in the web root if not desired. - Permalinks: All pages and posts load without 404 errors.
- SSL/HTTPS: Site loads securely over HTTPS, and mixed content warnings are resolved.
- Admin Account: Created with a unique username and a strong password.
FAQ
What are the advantages of installing WordPress manually over using a one-click installer?
Manual installation provides full transparency and control over every component of the server stack (Apache, MySQL, PHP). It results in a cleaner installation without potential bloat from automated scripts, allows for custom configurations from the start, and helps you develop valuable server administration skills.
Do I need to use Apache, or can I install WordPress on Nginx?
Yes, you can absolutely install WordPress on Nginx. The process for preparing the database and WordPress files is identical. The main difference lies in server configuration: you must configure Nginx to process PHP files (typically with PHP-FPM) and set up rewrite rules in your Nginx server block, rather than using an .htaccess file.
How do I fix the "Error establishing a database connection" after installation?
This error means WordPress cannot connect to your database. Carefully re-check the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST values in your wp-config.php file for typos. Ensure the database user has the correct privileges and that the database server is running. Also, confirm that localhost is the correct hostname, as some hosting providers use a specific server address.
Can I move a manually installed WordPress site to another server?
Yes. The process involves three main steps: 1) Export your database using a tool like phpMyAdmin or the command line, 2) Copy the entire WordPress directory (all files) to the new server, and 3) Import the database on the new server and update the wp-config.php file with the new database credentials. You may also need to update URLs in the database if the domain name changes.
Is manual installation suitable for a beginner with no command-line experience?
It can be a steep learning curve, but it's an excellent educational process. If you are uncomfortable with SSH and terminal commands, starting with a managed WordPress host or using your provider's one-click installer is recommended. However, following a detailed guide like this one step-by-step is a very effective way to learn the fundamentals of web server management.
Conclusion
A manual WordPress installation, while more hands-on than using automated tools, equips you with a solid, secure, and fully understood foundation for your website. By following these steps, you have direct oversight of your database, files, and server configuration, which is invaluable for customization, performance tuning, and security auditing. This method is particularly useful for developers building client sites or for anyone seeking to deepen their WordPress technical knowledge.
For those who prefer to focus purely on content and design, or if you are managing a high-traffic site that requires a managed environment, exploring managed WordPress hosting plans can provide automatic updates, enhanced security, and expert support while still offering great performance.
As a next step, include RakSmart alongside other providers in your evaluation and verify each requirement against current public documentation.

