2

Is it possible to set the Magento encryption key when using the magento setup:install command for unattended installation?

There does not appear to be a specific option for the encryption key. I tried adding --magento-init-params="crypt[key]=$encryption_key", but no luck.

In theory I could use sed or similar to edit the encryption key immediately after installing, but I would prefer to avoid this approach if possible.

Using Magento 2.2.4 on Ubuntu 18.04.

2

yes it is possible. try:

magento setup:install --key="YOURKEYHERE" ... OTHER ARGS ...

  • 1
    I actually found this and tried it, but I got an error. As I recall it was something along the lines of Encryption key cannot be longer than 32 bytes. Is there a particular way the key has to be formatted? I was just specifying it in hex as it appears in env.php. – Joseph Montanaro Aug 28 '18 at 16:51
  • It worked for me—I just used an ASCII key like the one autogenerated by Magento which was exactly 32 characters. – geerlingguy Nov 13 '18 at 21:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.