The Quickest way to deploy a local web server (WordPress Development)

The simplest way to set up a WordPress development environment is to use virtualization, I’ve to try XMAPP, local by flywheel, in the end, I find that setup my own Linux virtual machine is the most stable way to develop WordPress site locally.

Just find out you can do all of the below function with MS VS Code with plugins
Plugins you need as follow:
Live Sass Compiler
Live Server

npm + http-server package
npm – Get npm from node.js


npm install http-server -g

How to use


http-server [path] [options]
e.g.
http-server . -p 8081

Things you need
Windows

  1. npm – Get npm from node.js
  2. Sass – Install Sass from the command line

Ubuntu Desktop


    sudo apt update
    sudo apt install nodejs
    sudo apt install npm
    sudo npm install -g sass

Create a folder as your webroot folder and use the folder structure below

  • Webroot
    • css
    • img
    • js
    • sass
      • style.scss
    • index.html

Run the watch command on the sass folder

<link rel="stylesheet" type="text/css" href="./css/style.min.css">
sass --watch ./sass/style.scss ./css/style.min.css --style compressed

Run Python webserver

python3 -m http.server 80
OR
python -m http.server 80