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

Make sure Valet and WP-CLI are installed on your system.

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

Download WordPress core files –

Set database configuration on the wp-config file ( change DbName, DbUser, DbPass ) as you want –

wp core config --dbname=change-db-name --dbuser=root --dbpass= --dbhost=localhost

Create a Database as per the above configuration of the wp-config file –

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 a Valet Link to make the directory browsable –

valet link

Set WP_DEBUG and WP_DEBUG_LOG to true for the Dev environment

wp config set WP_DEBUG true --raw 
wp config set WP_DEBUG_LOG true --raw

Check the installed plugins list –

wp plugin list

Delete unwanted plugins –

wp plugin delete akismet
wp plugin delete hello

// Open code in VSCode

code .

Browse the site with your default 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
valet destroy

Similar Posts

Add your first comment to this post