> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.weltpixel.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to set Magento 2 Developer and Production Mode via SSH

# How to Set Magento 2 Developer and Production Mode via SSH

Switching between Developer and Production mode in Magento 2 is often necessary for development, debugging, or optimizing performance in a live environment. Here’s how to manage it via SSH.

---

## 1. Connect via SSH
Use an SSH client to connect to your server. Your hosting provider will supply the SSH credentials.  
👉 If you run into connection issues, make sure your IP is whitelisted.

---

## 2. Navigate to Your Magento Root Directory
Once connected, move into the root of your Magento 2 installation. Typically, this is inside the `html` folder.

```bash
cd mymagentostore.com/html
```

---

## 3. Check the Current Store Mode
Run the following command to see which mode your Magento store is currently using:

```bash
php bin/magento deploy:mode:show
```

---

## 4. Switch Between Modes

### a. Set Magento 2 to Developer Mode
Developer Mode is useful for debugging and module development.

```bash
php bin/magento deploy:mode:set developer
```

### b. Set Magento 2 to Production Mode
Production Mode is recommended for live sites to maximize performance.

```bash
php bin/magento deploy:mode:set production
```

---

## Notes
* On some servers, the `php bin/magento` command may not work directly.  
* Depending on your hosting provider, you may need to specify the PHP binary path. For example:

```bash
/usr/local/php56/bin/php-cli bin/magento deploy:mode:set developer
```

or

```bash
/usr/local/php70/bin/php-cli bin/magento deploy:mode:set production
```

---

✅ That’s it! You’ve successfully switched Magento 2 between Developer and Production modes using SSH.