Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesiTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
Install WordPress on Ubuntu Server 24.04 by putting Apache in front of PHP, connecting PHP to MySQL, and serving the WordPress files from a dedicated virtual host. The procedure below creates a least-purpose MySQL account, enables Apache rewrite rules, and ends at the WordPress web installer. It is suitable for a lab or single-site server; production deployments also need HTTPS, updates, firewall rules, backups, and tighter file isolation.
WordPress recommends PHP 8.3 or newer, MySQL 8.0 or newer (or MariaDB 10.11 or newer), HTTPS, and Apache or Nginx with rewrite support. Check the current compatibility list at WordPress requirements before choosing a repository or upgrading an existing host.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWhat you will build
A LAMP stack consists of Linux (Ubuntu), Apache, MySQL, and PHP. In this guide Apache serves /srv/www/wordpress, PHP runs through Apache’s PHP module, and MySQL stores WordPress content in a database named wordpress. The Apache virtual host listens on port 80 for the hostname you specify. You can use a temporary IP address for testing, but a real DNS name is required for a normal HTTPS deployment.
| Component | Choice in this guide | Purpose |
|---|---|---|
| Operating system | Ubuntu Server 24.04 | Base system and package manager |
| Web server | Apache 2 with mod_rewrite |
Accepts HTTP requests and serves WordPress |
| Database | MySQL Server | Stores posts, users, settings, and metadata |
| Application runtime | PHP supplied by Ubuntu, plus WordPress extensions | Executes WordPress code and connects to MySQL |
| Document root | /srv/www/wordpress |
Location of the WordPress release |
Prerequisites and sizing
Start with a fresh Ubuntu Server 24.04 amd64 installation and an account that can use sudo. For production, point a hostname such as example.com to the server before opening the installer. Decide where off-host backups will live and which firewall policy will allow SSH, HTTP, and HTTPS.
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.
Canonical lists 1.5 GB RAM as the minimum for an ISO installation and 1 GB for a cloud image. It lists 5 GB of minimum storage, while 3 GB RAM and 25 GB storage are suggested for a more useful server. These are Ubuntu installation figures, not a capacity guarantee for a busy WordPress site; media, plugins, logs, and database growth require additional disk space. See Ubuntu Server system requirements.
- Have the server’s current IP address and hostname available.
- Allow outbound package and certificate traffic.
- Use a terminal session with
sudoprivileges. - Choose a long, unique database password and store it in a password manager.
- For a public site, plan TLS certificates, automatic security updates, backups, restore tests, and monitoring before launch.
1. Update Ubuntu and install the LAMP packages
Refresh package metadata first. Point-version package numbers vary by Ubuntu repository and date, so verify the installed versions on the target host rather than hard-coding them.
sudo apt update
Install Apache, MySQL, PHP, and the extensions used by current WordPress releases. Canonical’s WordPress procedure uses this package set:
sudo apt install apache2 ghostscript libapache2-mod-php mysql-server php
php-bcmath php-curl php-imagick php-intl php-json php-mbstring
php-mysql php-xml php-zip
libapache2-mod-php connects PHP to Apache, while php-mysql supplies the MySQL driver that WordPress needs. Ubuntu documents both integration packages in its PHP installation documentation.
Confirm that the daemons and command-line PHP are available before copying any application files:
sudo systemctl status apache2
sudo systemctl status mysql
php -v
MySQL normally starts automatically after installation. If it is not active, start and enable it:
sudo systemctl enable --now mysql
sudo systemctl enable --now apache2
Ubuntu’s database instructions show service verification with sudo service mysql status; the equivalent systemctl command above provides the same check on Ubuntu 24.04. Refer to Ubuntu’s MySQL documentation if the service fails to start.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
2. Download WordPress into a controlled document root
Canonical recommends the current upstream WordPress release rather than the older Ubuntu archive package. Create the document root, give the web server account ownership for this simple single-site layout, and extract the release directly into it:
sudo mkdir -p /srv/www
sudo chown www-data: /srv/www
curl https://wordpress.org/latest.tar.gz | sudo -u www-data tar zx -C /srv/www
This creates /srv/www/wordpress. Check the result and make sure the expected entry point exists:
ls -la /srv/www/wordpress
ls -l /srv/www/wordpress/index.php
Shared www-data ownership is convenient for a learning server, but it gives every site using that account a wider trust boundary. On a multi-site or higher-risk host, create a separate Unix user for each site and run a dedicated PHP-FPM pool with matching permissions. Canonical warns that making all files owned by www-data can be insecure in that scenario; its complete procedure is at Install and configure WordPress.
3. Create the Apache virtual host
Apache keeps site definitions under /etc/apache2/sites-available. Create a file named /etc/apache2/sites-available/wordpress.conf and replace example.com with your DNS name. For a temporary IP test, you can use the server name that resolves to that address, but do not issue a certificate until DNS is correct.
<VirtualHost *:80>
ServerName example.com
DocumentRoot /srv/www/wordpress
<Directory /srv/www/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Require all granted
</Directory>
<Directory /srv/www/wordpress/wp-content>
Options FollowSymLinks
Require all granted
</Directory>
</VirtualHost>
Write the file with an editor, for example:
sudo nano /etc/apache2/sites-available/wordpress.conf
Enable the site and rewrite module, disable the default welcome page if it would otherwise win the virtual-host match, then reload Apache:
sudo a2ensite wordpress
sudo a2enmod rewrite
sudo a2dissite 000-default
sudo apache2ctl configtest
sudo systemctl reload apache2
apache2ctl configtest should report Syntax OK. Apache’s layout and service commands are described in Ubuntu’s Apache documentation. If you need to keep the default site for another application, leave it enabled but ensure the WordPress hostname has an exact ServerName and, where necessary, a ServerAlias.
4. Create a dedicated MySQL database and user
Do not use MySQL’s administrative account in WordPress. Create one schema and one local-only account whose privileges are limited to that schema. Open the local MySQL client as the system administrator:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
sudo mysql
Run the following SQL, replacing the example password with a randomly generated value. The database name, username, and password must match the values you will place in wp-config.php.
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'replace-with-a-long-random-password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost';
FLUSH PRIVILEGES;
EXIT;
The localhost host restriction keeps this account from accepting remote database logins. The grant covers only the WordPress schema, not every database on the server. Canonical demonstrates this least-purpose pattern in its WordPress tutorial. WordPress documents the corresponding DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST settings in its installation guide.
You can verify the credentials before involving Apache:
mysql -u wordpress -p -h localhost wordpress
Enter the password when prompted, run SHOW TABLES; (an empty result is expected for a new schema), and type EXIT;.
Recommended Free Tools
5. Generate wp-config.php securely
Copy the sample configuration as the web-server account, then substitute the database values:
sudo -u www-data cp /srv/www/wordpress/wp-config-sample.php /srv/www/wordpress/wp-config.php
sudo -u www-data sed -i 's/database_name_here/wordpress/' /srv/www/wordpress/wp-config.php
sudo -u www-data sed -i 's/username_here/wordpress/' /srv/www/wordpress/wp-config.php
sudo -u www-data sed -i 's/password_here/replace-with-a-long-random-password/' /srv/www/wordpress/wp-config.php
Open the file and replace every authentication-key and salt placeholder with fresh values from the official WordPress secret-key service or another trustworthy random generator. Do not reuse salts from another site. A typical review command is:
sudo -u www-data nano /srv/www/wordpress/wp-config.php
Keep wp-config.php readable only by the accounts that need it, and treat every backup containing it as a secret because it includes database credentials. The Apache configuration serves PHP files through the PHP handler; it should never send this file as a downloadable text document. If PHP is misconfigured, stop and fix that condition before exposing the site.
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
6. Run the WordPress web installer
From a browser, visit the hostname configured in ServerName, for example http://example.com/. WordPress should display its setup screen rather than Apache’s default page. Enter a site title, an administrator username that is not an obvious guess, a unique administrator password, and an email address you can access. Complete the installation and sign in to the new dashboard.
WordPress describes this as a deliberately simple process in its official installation sequence. If the browser cannot reach the page, test locally on the server first:
curl -I http://127.0.0.1/
curl -I -H 'Host: example.com' http://127.0.0.1/
A response such as 200 OK or a normal WordPress redirect confirms that Apache is answering. A connection refusal points to the service or firewall; the wrong page usually points to virtual-host selection or DNS.
7. Confirm the stack before adding plugins
Check each layer independently so a later WordPress error has a clear boundary:
- Apache: run
sudo systemctl is-active apache2andsudo apache2ctl configtest. - MySQL: run
sudo systemctl is-active mysql, then test the WordPress account withmysql -u wordpress -p -h localhost wordpress. - PHP: run
php -vand confirm that the loaded major version meets WordPress’s current recommendation. - PHP modules: run
php -m | grep -E 'mysqli|mysqlnd|curl|mbstring|xml|zip|imagick|intl|bcmath'. The web SAPI can load a different configuration, so use a temporary, non-public diagnostic only if command-line and browser behavior disagree, then delete it. - File access: verify that
www-datacan read the release and write only where uploads or updates require it, especiallywp-content. - Logs: inspect
sudo journalctl -u apache2and Apache’s error log when a request fails.
HTTP testing versus a production HTTPS deployment
Plain HTTP is useful for proving that the LAMP stack and virtual host work. It is not an acceptable final state for an internet-facing WordPress login or administration session. WordPress includes HTTPS in its recommended baseline; obtain a certificate for the real domain, test it, and then redirect HTTP to HTTPS.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Before requesting a certificate
- Make the domain’s A or AAAA record resolve to this server.
- Allow inbound TCP 80 and 443 through the host firewall and any cloud security group.
- Ensure Apache answers the domain without a conflicting default virtual host.
- Keep an SSH session available in case a redirect or TLS change needs to be reversed.
After the certificate works
- Add an HTTPS virtual host and redirect the port-80 host to the HTTPS URL.
- Set WordPress and the site URL consistently to the HTTPS scheme; mixed-content warnings often indicate old HTTP URLs in content or plugin settings.
- Renew certificates automatically and monitor renewal failures.
- Expose only required services in the firewall, normally SSH from trusted sources plus HTTP and HTTPS.
Do not claim the site is secure merely because a certificate is installed. Keep Ubuntu, Apache, PHP, MySQL, WordPress core, themes, and plugins patched, remove unused extensions, and schedule encrypted database and file backups. Test restoring a backup on a separate location so a backup that cannot be restored does not become your only recovery plan.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting the common failures
Apache still shows its default page
Run sudo a2ensite wordpress, check that /etc/apache2/sites-available/wordpress.conf contains the correct ServerName and document root, and reload Apache. Disable 000-default if it is catching the request. Test virtual-host matching with sudo apache2ctl -S; DNS or a missing Host header can send you to another site.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
PHP downloads or appears as source code
Confirm that libapache2-mod-php is installed, the Apache module is enabled, and Apache has been reloaded. A package install alone does not repair a stale worker process. Check sudo apache2ctl -M | grep php and review the Apache error log. Ubuntu documents libapache2-mod-php as the Apache integration path at its PHP documentation.
WordPress says the PHP MySQL extension is missing
Install the missing driver with sudo apt install php-mysql, verify the loaded PHP version with php -v, and reload Apache. If the command line shows the module but WordPress does not, Apache may be using a different PHP configuration; inspect the enabled module and service logs. The extension is required for WordPress-to-MySQL connectivity, as described in the WordPress installation guide.
“Error establishing a database connection”
First check sudo systemctl status mysql. Then compare every value in wp-config.php with the actual schema and grant: DB_NAME must be wordpress, DB_USER must be wordpress, DB_PASSWORD must match exactly, and DB_HOST should normally be localhost for the account created here. Test the same combination with mysql -u wordpress -p -h localhost wordpress. MySQL service checks are covered in Ubuntu’s MySQL documentation.
Pretty permalinks return 404
Enable rewriting with sudo a2enmod rewrite, confirm that the WordPress directory allows FileInfo overrides, and reload Apache. The supplied virtual host uses AllowOverride Limit Options FileInfo, which permits WordPress’s .htaccess rewrite rules without enabling every possible override. Check that /srv/www/wordpress/.htaccess exists after saving permalink settings.
Media uploads fail or updates request FTP credentials
Inspect ownership and permissions under /srv/www/wordpress/wp-content. The PHP process must be able to write the upload and update directories, but the whole installation should not be world-writable. Correct the specific directory ownership rather than applying a blanket permissive mode. On a shared or multi-site server, move to per-site users and isolated PHP-FPM pools instead of expanding www-data‘s access.
Requests time out or the site is unreachable
Verify that Apache is active, the server is listening with sudo ss -ltnp | grep -E ':80|:443', and the cloud firewall and Ubuntu firewall allow the required ports. Test from the server with curl to separate a network problem from an application problem. If only the domain fails, inspect DNS records and the browser’s proxy or cached address.
Free tools Windows power users keep installed
One-click scans. No signup required.
Single-site convenience versus hardened multi-site design
| Concern | Simple layout in this guide | More isolated production layout |
|---|---|---|
| Unix ownership | www-data owns the release for one site |
Separate Unix user per site |
| PHP execution | Apache PHP module | Dedicated PHP-FPM pool per site |
| Operational effort | Low; fewer services and permissions to configure | Higher; pool limits, sockets, users, and deployment permissions require management |
| Blast radius | A compromised site account may affect other content using the same account | Per-site identities and pools reduce cross-site access |
| Best fit | Learning server or isolated single-site host | Multiple customers, high-risk applications, or strict separation requirements |
The choice is architectural, not a WordPress feature setting. Start with the simple arrangement only when the host is genuinely single-purpose, and migrate to isolation before placing unrelated sites or untrusted users on the same machine.
Ongoing maintenance checklist
- Apply Ubuntu security updates and reboot when the kernel or critical libraries require it.
- Update WordPress core, themes, and plugins promptly; remove components that are no longer maintained.
- Review Apache and MySQL logs for repeated authentication failures, 5xx errors, and disk-space warnings.
- Back up the database and
wp-contentseparately from the rest of the operating system, encrypt copies, and test a full restore. - Monitor free disk space, RAM, certificate expiry, and backup success.
- Use a non-obvious administrator username, strong unique credentials, and multi-factor authentication when an appropriate plugin or identity provider is available.
- Keep the database account limited to the WordPress schema and never share its password with site editors.
When managed WordPress hosting is a better fit
Self-hosting gives you root access, package choice, network and database control, and portability. It also makes you responsible for patching, backups, TLS renewal, firewall configuration, capacity planning, and recovery. Specialized WordPress hosts may bundle preinstallation, backups, updates, and developer tooling, but the trade-off is less control and a provider-specific migration process. Compare administrative control, who performs patches, backup and restore tooling, HTTPS automation, scaling options, total recurring cost, and how easily you can export the database and files before choosing.
The Bottom Line
Once Apache serves /srv/www/wordpress, PHP has the MySQL extension, and the dedicated database credentials work, the WordPress installer should load at your configured hostname. Use HTTP only for initial verification; finish a public deployment with HTTPS, least-privilege permissions, updates, firewall rules, and tested backups.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →

