Step-by-Step Guide: Creating a WordPress Website Locally with Valet and WP-CLI

Make sure Valet and WP CLI is installed in your system.

Create your Local website directory and enter to it – (Set directory name your directory)

Download WordPress core files –

/Change DbName, DbUser, DbPass
wp core config --dbname=gb-starter --dbuser=root --dbpass= --dbhost=localhost

// Create Database as per above configuration.
wp db create

Install WordPress (Set URL, Title, UserName, Password, and Email) –

wp core install --url=http://gb-starter.test --title="Guternberg Starterkit" --admin_user=admin --admin_password=admin [email protected]

Check Database tables –

wp db check

// Create Valet Link
valet link

// To set WP_DEBUG and WP_DEBUG_LOG to true for Dev environment
wp config set WP_DEBUG true --raw
wp config set WP_DEBUG_LOG true --raw

// Open code in VSCode
code .

// Open Site in Browser
valet open

remove directory (remove default plugin)
rm -r DirName

Revmove File
rm -rf FileName

To add SSL
valet secure

To remove SSL:
valet unsecure

Destroy the site:
valet destroy

Similar Posts

Add your first comment to this post