<p>You can run the <code>craft setup/security-key</code> console command after cloning the repo.  That'll generate a security key for that Craft install and put it in the local <code>.env</code> file.</p>

<p>Or for that matter, <code>craft setup</code> will run the whole setup process (database credeitials, security key, etc.).</p>

<blockquote>
  <p>Are there other security considerations to take into account?</p>
</blockquote>

<p>Keep your <code>craft/config/license.key</code> out of the repo so that a new one is generated for each cloned site.</p>

CC BY-SA 3.0
2018-03-22T08:13:21.127Z
Works perfectly, thanks a lot, also for the hint about the license key.
Anthronaut
CC BY-SA 3.0
2018-03-20T21:30:20.777Z
2018-03-20T21:30:20.777Z
Brad Bell
<p>We have set up a Craft 3 installation with composer to serve as boilerplate for a number of upcoming projects. The installation sits in a private git repository and the plan is to clone it when we start a new project.</p>

<p>Everything works fine, but since new projects will spawn from the boilerplate, the Security Key is the same for all of them - which probably is a bad idea.</p>

<p>Is there a way to assign a new security key when we clone the boilerplate for a new project? Are there other security considerations to take into account?</p>

<p>Thanks a lot!</p>

<craft3><security>
Security Key and Boilerplate
# Security Key and Boilerplate

(Asked by: username_0 on 2018-03-20)

We have set up a Craft 3 installation with composer to serve as boilerplate for a number of upcoming projects. The installation sits in a private git repository and the plan is to clone it when we start a new project.

Everything works fine, but since new projects will spawn from the boilerplate, the Security Key is the same for all of them - which probably is a bad idea.

Is there a way to assign a new security key when we clone the boilerplate for a new project? Are there other security considerations to take into account?

Thanks a lot!

**Tags:** craft3, security


---

## 1 answers

### Answer by username_1 on 2018-03-20. Score: 5 | Accepted answer

You can run the `craft setup/security-key` console command after cloning the repo. That'll generate a security key for that Craft install and put it in the local `.env` file.

Or for that matter, `craft setup` will run the whole setup process (database credeitials, security key, etc.).

> Are there other security considerations to take into account?

Keep your `craft/config/license.key` out of the repo so that a new one is generated for each cloned site.

> **Comments:**
> **username_0**: Works perfectly, thanks a lot, also for the hint about the license key.  

---

