Skip to content

Instantly share code, notes, and snippets.

@emiliodallatorre
Last active April 20, 2024 10:37
Show Gist options
  • Save emiliodallatorre/aaa80a95d55dd06bd17fcdbb22c6e9e2 to your computer and use it in GitHub Desktop.
Save emiliodallatorre/aaa80a95d55dd06bd17fcdbb22c6e9e2 to your computer and use it in GitHub Desktop.
# Create VM istance and log into it
multipass launch --name jetop-wordpress
multipass shell jetop-wordpress
# Update packages
sudo apt update && sudo apt upgrade -y
# Install nginx and net-tools
sudo apt install nginx net-tools
# Install PHP and deps
sudo apt install ghostscript php-fpm php-curl php-imagick php-intl php-json php-mbstring php-mysql php-xml php-zip
# Install MySQL Server
sudo apt install mysql-server
# Log into MySQL as root
sudo mysql -u root
# Commands to create MySQL account for WordPress
# https://gist.github.com/emiliodallatorre/884cfc533ce49a23504ac41d8b5ebc26
# Commands to download WordPress core
cd /var/www/html
curl https://wordpress.org/latest.tar.gz | sudo -u www-data tar zx -C .
# Insert correct data into wp-config.php
sudo cp wp-config-sample.php wp-config.php
sudo sed -i 's/database_name_here/wordpress/' wp-config.php
sudo sed -i 's/username_here/wordpress/' wp-config.php
sudo sed -i 's/password_here/<your-password>/' wp-config.php
# We fix the permissions
sudo chown www-data:www-data -R /var/www/html/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment