If you’ve got a fresh Debian 9 server and you just want WordPress running without drama, this guide is for you.
Before: you’ve got a blank server, maybe Apache/PHP/MariaDB installed, but nothing useful to show to the client or your boss.
After: you’ll have WordPress installed under /wordpress, working in the browser, and ready to be hooked to a domain name later.
I’ll walk through the install steps in a practical way so you don’t have to keep guessing what goes where.
1. What You Need Before Installing WordPress
This guide assumes you already have the basic web stack ready on Debian 9 Server:
- Apache web server
- PHP
- MariaDB (with a database and user ready for WordPress)
If any of those are missing, stop here and install them first. WordPress is just PHP code and needs a web server and database to live on.
Very short checklist before continuing:
- Apache is installed and running
- PHP is installed and enabled in Apache
- MariaDB is installed and running
- You’ve already created a database and user for WordPress in MariaDB
If one of those is missing, fix it first, then come back here.
2. Download and Extract WordPress to the Web Folder
WordPress runs from a regular directory under Apache’s document root. On Debian 9, the default document root is:
/var/www/html
We’re going to place WordPress there, in a folder called wordpress.
Basic steps:
- Download WordPress
- Grab the official WordPress package (
wordpress.tar.gz). -
Save it somewhere on the server, typically in your home directory or directly in
/var/www/html. -
Extract WordPress to
/var/www/html - Move the downloaded file to
/var/www/htmlif it’s not there already. -
Extract it so you end up with this path:
/var/www/html/wordpress - Check the directory
- After extraction, you should see standard WordPress files and folders inside:
wp-admin/wp-content/wp-includes/index.php,wp-config-sample.php, and so on.
Tip: keep the folder name simple (wordpress). You can change it later if you want a different URL path.
3. Fix Ownership: Let Apache Own the WordPress Folder
WordPress needs to be readable by Apache, and for updates/plugins/themes to work smoothly, Apache usually needs write access too.
On Debian, the Apache web server process runs under a specific user and group. You need to change the owner of the wordpress folder to that Apache user and group.
Steps:
- Change user and group of the
wordpressdirectory - Use
chownto set the directory owner to Apache’s user and group (as required on your system): -
Apply it recursively so all files inside
wordpressuse the same owner. - Why this matters
-
Without proper ownership, you’ll hit permission errors when:
- Uploading media
- Installing themes or plugins
- Updating WordPress core
- Quick safety tip
- Only change ownership for the WordPress folder, not the whole
/var/wwwdirectory. - This keeps the rest of your server a bit safer and avoids messing up other sites.
Once ownership is right, Apache will be able to serve the files and WordPress will be able to write its config file later.
4. Run the WordPress Web Installer
Now for the more fun part: installing WordPress through the browser.
Before you start, make sure both Apache and MariaDB are running. If either one is down, the installer will fail or throw database errors.
- Open the installer in your browser
- Go to:
http://ip-server/wordpress -
Replace
ip-serverwith your server’s IP address. - Choose your language
- The first screen asks you to pick a language for the install process.
- Default is English – that’s fine for most cases.
- Click Continue when ready.
- Read the database requirements screen
- WordPress tells you what it needs:
- Database name
- Database username
- Database password
- Database host
- Table prefix (optional)
- This information will be written into
wp-config.php. - Click Let’s go! to continue.
If you get an error at this point, double-check that Apache is serving the wordpress directory and that PHP is properly installed and enabled.
5. Connect WordPress to MariaDB
Now WordPress needs the database connection details you prepared earlier.
- Fill in the database form
- Database Name: the database you created earlier in MariaDB for WordPress.
- Username: the MariaDB user that has access to that database.
- Password: the password for that user.
- Database Host: usually
localhoston a local server. -
Table Prefix: leave as
wp_unless you have a specific reason to change it. - Submit the form
- Click Submit.
-
WordPress tries to create
wp-config.php - If login to the database is successful and permissions are OK, WordPress will confirm that it can write the configuration.
- You’ll see a message that connection is successful and that
wp-config.phpcan be created. - Click Run the installation to go to the next step.
If this step fails:
- Re-check the database name, user, and password.
- Make sure the MariaDB server is running.
- Ensure the user has permission to access that database.
Once this works, the wp-config.php file will be in place and WordPress is ready to initialize itself.
6. Set Up Your WordPress Site and Admin User
Now you tell WordPress what this site is and who the admin is.
- Fill the site details form
- Site Title: the title of your website (you can change it later in Settings).
- Username: admin username for logging into the dashboard.
- Password: choose a strong password and keep it safe.
- Your Email: admin contact email used for notifications and password resets.
- Start the installation
- Click Install WordPress.
- Finish and log in
- After install completes, you’ll see a success message.
- Click Log In to go to the login page.
- Or visit:
http://ip-server/wordpress/wp-admin
From there you can log into the WordPress dashboard with the username and password you just created.
To see the public site, just open:
http://ip-server/wordpress
That’s your front-end homepage.
7. Accessing WordPress with a Domain Name
By default in this setup, WordPress is accessed as:
http://ip-server/wordpress
That works fine for internal testing or local use. But on a real server, you’ll want to use a domain instead of the raw IP.
The basic idea when using a domain is:
- Point your domain to your server (DNS).
- Configure your server so the domain name serves the WordPress directory.
In this context, the original tutorial mentions using a server that’s already online, such as a VPS. When your server is on the internet and reachable, you can:
- Use your domain instead of
ip-serverin the URL. - Access WordPress via something like:
http://your-domain.com/wordpress
The key point is: the steps you’ve done so far (installing WordPress to /var/www/html/wordpress) still apply. Switching from IP to domain is about DNS and web server configuration, not about re-installing WordPress.
8. Quick Recap and Next Steps
Let’s recap what you’ve done:
- Prepared Debian 9 with Apache, PHP, and MariaDB (with a database and user ready).
- Downloaded and extracted WordPress to
/var/www/html/wordpress. - Set ownership so Apache can read/write the WordPress files.
- Ran the web installer via
http://ip-server/wordpress. - Connected WordPress to your MariaDB database.
- Created the site title and admin user, and logged into the dashboard.
- Learned that you can later swap the IP for a domain when the server is online.
From here, you can start installing themes, plugins, and building out your site.
Need more help? Check the latest CrushEdge posts.
No Comments