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.

// Name your directory
mkdir gb-starter && cd gb-starter

wp core download

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

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

// Set URL, Title, UserName, Pass, Email
wp core install --url=http://gb-starter.test --title="Guternberg Starterkit" --admin_user=admin --admin_password=admin [email protected]

// Check DB 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