---
title: "How to enable Varnish for Magento 2 on Nexcess Cloud"
source: "https://docs.nexcess.com/sites-stores/managed-magento/store-management/varnish-for-magento-2/"
description: "Enable Varnish for Magento 2 on the Nexcess Cloud infrastructure. Learn how Nexcess Cloud clients can enable Varnish, a web application accelerator for static i…"
vertical: "Sites & Stores"
date: "2019-09-11"
last_modified: "2026-07-06"
---

# How to enable Varnish for Magento 2 on Nexcess Cloud

## Prerequisites

- Your [Client Portal](https://portal.nexcess.net/) login credentials. If you cannot locate them, click **Forgot Password?** on the login page.
- An existing Nexcess Cloud Magento 2 account. See [How to create Nexcess Cloud accounts](https://docs.nexcess.com/sites-stores/hosting-services/sites-and-stores/create-flex-plan/) for more information.
- Login credentials and admin access to your Magento 2 store.

## Step by step instructions

1. Log in to [sites-portal.liquidweb.com](https://portal.nexcess.net/).
2. From the home page, click **Plans.**
3. From the home page, click your desired Magento cloud service.
4. Select **Menu > Containers**.
5. In the Varnish section on the **Containers** page, click **Enable**.
6. Choose your plan, then click **Enable**.
7. Allow a few moments for setup to complete, then note the hostname and port information.
8. Log in to your Magento 2 admin panel. To do this from your Client Portal, select **Menu > Environment**, then click **App Admin**.
9. Select **Stores < Configuration**.
10. Scroll down and select **Advanced > System**.
11. Select **Full Page Cache**. In Caching Application, clear the **Use system value** check box, then select **Varnish Cache (Recommended)**.
12. Under Varnish Configuration, in the **Backend host** field, enter the hostname you were provided from Step 7. In the **Backend port** field, enter the number for “Main Port”.
13. Click **Save Config.**

```
php bin/magento setup:config:set --http-cache-hosts=ENDPOINT:PORT
```

Using the information from Step 2F as an example, the command would be:

```
php bin/magento setup:config:set --http-cache-hosts=us-midwest-1.nxcli.net:1383
```

## Verify full-page caching is enabled

1. From the command line, enter:

```
php bin/magento cache:status
```

If you see a 0 next to full\_page, as below:  
![](https://docs.nexcess.com/wp-content/uploads/2026/06/1571680397290-1571680397290.png)  
Then, enter:

```
php bin/magento cache:enable full_page
```

## Purge the cache in the portal

If you need to purge the Varnish page cache for your site you can do so in the **performance** menu tab of the portal. Click on the **Purge Cache** button which will clear the [NGNIX micro-cache](https://www.liquidweb.com/open-source-hosting/cloud-accelerator/) and the Varnish page cache.
