# Wordpress bash scaffolder script

**URL:** <https://community.kinsta.com/t/wordpress-bash-scaffolder-script/2114>\
**Category:** Community Guides\
**Created:** [March 6, 2023, 1:17pm UTC](https://community.kinsta.com/t/wordpress-bash-scaffolder-script/2114 "2023-03-06T13:17:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidH](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/davidh/32/1954_2.png) [@DavidH](https://community.kinsta.com/u/DavidH)\
**Post date:** [March 6, 2023, 1:17pm UTC](https://community.kinsta.com/t/wordpress-bash-scaffolder-script/2114/1 "2023-03-06T13:17:36Z")

</div>

Before using DevKinsta, I was using Laragon. I would like to find a similar approach. I’m still on Windows.  
To create a new site from Laragon with WP CLI, here is what I could do:

- create a new folder (Laragon would detect this new folder and generate a new vhost)
- launch an install.sh script `sh install.sh` which launched the installation of wordpress, generation of the wp-config file, installation of a list of plugins, update of options (deactivation of comments, date format, post\_per\_page, etc …)

I would like to be able to launch this type of script:

```bash
wp core download --locale=en_FR --force
wp config create --dbname=$db_name --dbuser=root --dbpass="" --dbprefix=$db_prefix --skip-check --extra-php
wp db create
wp core install --url=$site_url --title="$site_title" --admin_user=$admin_user --admin_email=$admin_email --admin_password=$admin_user_password
wp plugin install plugin-1
wp plugin install plugin-2
rm -rf wp-content/themes/twenty*
rm wp-content/plugins/hello.php
rm -rf wp-content/plugins/akismet
wp plugin activate --all --quiet

```

Is it currently possible to create a wordpress site without going through the devKinsta interface? If I create a folder and a wp-config file, how do I find it in the kinsta interface ?

How to launch a .sh script ? Currently I need to connect to the docker container to be able to do this and I don’t know where or how I should put and launch the script.

If the quick creation by script.sh is not possible how to launch at least the sh script without the wordpress/database creation/installation, just for the options update and the plugins installation?

Another question, how to make quick commands to connect to containers and save time?

- docker exec -u www-data -it devkinsta\_fpm bash =\> `kinsta-fpm`
- docker exec -it devkinsta\_db bash =\> `kinsta-db`

---

<div class="post-metadata">

**Author:** ![Agus](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/agus/32/1515_2.png) [@Agus](https://community.kinsta.com/u/Agus)\
**Post date:** [March 7, 2023, 3:59am UTC](https://community.kinsta.com/t/wordpress-bash-scaffolder-script/2114/2 "2023-03-07T03:59:21Z")

</div>

Hello @DavidH 👋

I will try to answer your questions as follow:

> Is it currently possible to create a wordpress site without going through the devKinsta interface? If I create a folder and a wp-config file, how do I find it in the kinsta interface ?

I don’t see a way/method to create a WP site manually without going through the DevKinsta interface - and then to see that WP site created manually in DevKinsta interface.

Yes, in order to execute that WP CLI (for example to install WP plugin), you can put the commands in a .sh script then execute it through the docker container ( devkinsta\_fpm ).

So for example, you may want to do the following:

1. Create a `scripts.sh` file (with text editor) inside this folder, let’s say:  
`C:\Users\youruser\DevKinsta\public\sitename`

2. Put the WP CLI into that scripts.sh file (with text editor for example)  
you may want to put something like these to test:  
`wp plugin install plugin-name-here`  
`wp plugin activate --all --quiet`

3. connect to your `devkinsta_fpm` docker container:  
`docker exec -u www-data -it devkinsta_fpm bash`

4. once connected in that `devkinsta_fpm` docker container, you can type:  
`cd /www/kinsta/public/sitename`  
In this folder, you will see that `scripts.sh` file you just created before

5. You can then execute that scripts.sh file with:  
`sh scripts.sh`  
this will run those 2 WP CLI commands saved in that script.sh file above.  
Note:  
If you add this line `rm -rf wp-content/themes/twenty*` in that script.sh, it will be executed as well, and will remove those themes folders/files (e.g.: twentytwenty/ twentytwentyone/ twentytwentythree/ twentytwentytwo/)

For this one:

> Another question, how to make quick commands to connect to containers and save time?
> 
> - docker exec -u www-data -it devkinsta\_fpm bash =\> `kinsta-fpm`
> - docker exec -it devkinsta\_db bash =\> `kinsta-db`

You can create a `.bat` file on your local computer (Windows) which contains that docker command.  
For example, you can create a new batch file and name it as: `kinsta-fpm.bat`  
then edit that `kinsta-fpm.bat` file and add the following lines in it (and save it):

```auto
@echo off
docker exec -u www-data -it devkinsta_fpm bash

```

after that, from the windows CMD / dos prompt, if you run that `kinsta-fpm.bat` , then it will execute that docker command line.

Like this (see the screenshot) I took on my Windows machine:

 ![Screenshot from 2023-03-07 10-58-38](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/2X/4/4fb601f0c81cb85037146ba93a1bfe98d2489a1f.png)

Hope the above answers would help 🙂

Cheers,  
Agus

---

<div class="post-metadata">

**Author:** ![DavidH](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/davidh/32/1954_2.png) [@DavidH](https://community.kinsta.com/u/DavidH)\
**Post date:** [March 8, 2023, 2:30am UTC](https://community.kinsta.com/t/wordpress-bash-scaffolder-script/2114/3 "2023-03-08T02:30:26Z")

</div>

Thank you I’ll try to put it all together

---

<div class="post-metadata">

**Author:** ![Agus](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/agus/32/1515_2.png) [@Agus](https://community.kinsta.com/u/Agus)\
**Post date:** [March 8, 2023, 3:39am UTC](https://community.kinsta.com/t/wordpress-bash-scaffolder-script/2114/4 "2023-03-08T03:39:20Z")

</div>

You’re most welcome David! 😃  
Sounds good! please take your time and see if those work as expected!

Cheers,  
Agus

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/kinsta/original/2X/8/80f8c4e56fecc02327a0964e6bf63a716483529f.png) [@system](https://community.kinsta.com/u/system)\
**Post date:** [March 7, 2026, 3:40am UTC](https://community.kinsta.com/t/wordpress-bash-scaffolder-script/2114/5 "2026-03-07T03:40:12Z")

</div>

This topic was automatically closed 1095 days after the last reply. New replies are no longer allowed.
