so I am trying to make a bash script in Magento, and I am learning from the bottom up. So I have the basic arguments ready to be used in the script I am making, but when I execute

sudo php magento setup:install --admin-user="user"

or a variation with [--admin-user="user"]

I get

[RuntimeException] Too many arguments.

enter image description here

What am I doing wrong? I would like to put that line in my script, so I can install Magento with user defined variables

I am using Magento 2.0.2 with Sample Data on Ubuntu 15.02

  • 2
    I recently wrote a simple bash script for setting up Magento 2 that creates an instance from a GitHub repo, sets up an Nginx config and installs the software based on user input. You may be interested in it github.com/affinitycloud/magesetup Feb 21 '16 at 19:38

I think you have forgot about the -- in front of the command. (So it seems in your screenshot).

  • Stupid me, the command works now! thanks!!!
    – Maarten
    Feb 18 '16 at 13:55

I had a similar issue and the correct installation command is:

php bin/magento setup:install 

Install Magento 2 using CLI

As mentioned, in your case command line options for the Magento 2 CLI installer require -- before the option name (e.g --base-url="example.com")

  • in wamp its working fine for magento2.3 and php7.2.4. make sure its in single line.
    – MageLerner
    Nov 29 '18 at 7:08

Please remove the double brackets and run the following command.

bin/magento setup:install --backend-frontname="adminlogin" \
--key="biY8vdWx4w8KV5Q59380Fejy36l6ssUb" \
--db-host="localhost" \
--db-name="magentodb" \
--db-user="root" \
--db-password="secretpassword" \
--language="en_US" \
--currency="GBP" \
--timezone="Europe/London" \
--use-rewrites=1 \
--use-secure=0 \
--base-url="http://www.newmagento.com" \
--base-url-secure="https://www.newmagento.com" \
--admin-user=adminuser \
--admin-password=admin123@ \
--admin-email=admin@newmagento.com \
--admin-firstname=admin \
--admin-lastname=user \

create a new file name it install.sh , use a text editor to paste that command , save it. chmod +x install.sh and do ./install.sh


You can use proper command line

php bin/magento setup:install --base-url="http://localhost/sport/" --db-host="localhost" --db-name="sports" --db-user="root" --admin-firstname="admin" --admin-lastname="admin" --admin-email="admin@admin.com" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin"

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.