Showing results for 
Search instead for 
Did you mean: 

How to get started with CLI?

How to get started with CLI?

I'm all new at this and want to learn more.


All the guides and all the information I find on Magento seems to mention codes, CLI and more. I fail to find any information on which programs and how I can do this?


I had a web hoster with a control panel that could install Magento, but this is limited and have no access to any CLI and I can't make a cron job working with this - Which messes with my indexes. How should I continue from here?


Another problem is that apparantly nothing works if I chose to install with the apache rewrite feature, how can I fix this?


Re: How to get started with CLI?

Hello Nemiq,

We use CLI for Magento 2 for compilation, reindexing, upgrade, cache clean etc. At the beginning, we also have lots of problems but now we are very comfortable with it. CLI is very fast rather than UI. You can also install Magento using  CLI. 

Here are some important commands which are used frequently:

1. sudo php bin/Magento setup:upgrade - for updating the Magento 

2. sudo php bin/magento setup:di:compile - for compiling the Magento and modules. whenever make changes in classes you have recompile

3. sudo php bin/magento cache:clean - for clearing all cache

4. sudo php bin/magento setup:static-content:deploy - to redeploy the static content.

above command can be executed from magento root directory.

Re: How to get started with CLI?

To use the Magento CLI you need SSH access to your server. You can contact your host regarding this. If SSH access cannot be obtained you cannot use the CLI unfortunately.

Sindre M, CEO & Founder - The Magento Hosting Experts