Wanna launch a WordPress site for testing purposes ASAP? Follow this guide and you’ll be up and running in less than 5 minutes.
Note that this is for testing purposes etc. and not for production use. For production use, you should follow more secure procedures.
If you don’t run a Linux OS just grab one.
Run the following in the terminal to install the LAMP stack:
sudo apt update && sudo apt upgrade -y
sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql php-gd php-mbstring php-xml unzip -y
Download WordPress:
cd /var/www/html
sudo wget https://wordpress.org/latest.zip --no-check-certificate
sudo unzip latest.zip
sudo mv wordpress/* .
sudo rm -rf wordpress latest.zip
Set correct permissions:
sudo chown -R www-data:www-data /var/www/html
sudo chmod -R 755 /var/www/html
Log in to MySQL:
sudo mysql -u root -p
-p
prompts you the root password.
Create the WordPress database and user:
CREATE DATABASE wordpress;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Rename index.html as it shows the default Apache page:
sudo mv index.html index.html.bak
Open your browser and visit:
http://localhost/
Follow the WordPress setup wizard:
Database Name: `wordpress`
Username: `wpuser`
Password: `password`
Host: `localhost`
Complete the installation by setting an admin username, password, and email. You can save the password to the browser and the email can be [email protected]
. This @example.com
is reserved for testing by IANA and thus not used by real people.
Trouble Shooting
REST API not working
Check ‘AllowOverride’ is set to ‘All’.
<Directory /var/www/html/your-site>
AllowOverride All
Require all granted
</Directory>
Change Settings > Permalinks to anything but ‘plain’. This automatically rewrites rules in .htaacess
.