---
title: "How to create Magento 2 dev sites"
source: "https://docs.nexcess.com/sites-stores/managed-magento/store-management/dev-site-for-magento-2/"
description: "How Nexcess clients on physical (non-cloud) clients can create Magento 2 development (dev) sites."
vertical: "Sites & Stores"
date: "2019-09-11"
last_modified: "2026-07-02"
---

# How to create Magento 2 dev sites

## **Prerequisites**

- A working, [preferably current](https://magento.com/security) installation of Magento 2
- A Nexcess account on a physical (non-cloud) account and access to SiteWorx; If you use Nexcess Cloud, see instead [What are Nexcess Cloud dev sites?](https://www.liquidweb.com/help-docs/hosting-services/nexcess/) for details regarding dev site creation
- MySQL or phpMyAdmin (via SiteWorx)
- SSH (recommended), FileZilla, or a similar file-transfer utility

## **Step by step instructions**

Non-cloud server only

This method is intended only for Nexcess clients on physical (non-cloud) servers. If you use Nexcess Cloud, see instead [What are Nexcess Cloud dev sites?](https://www.liquidweb.com/help-docs/hosting-services/nexcess/) for details about dev site creation.

1. Create the secondary domain to serve as the dev site. For details, refer to [How to add secondary domains with SiteWorx](https://docs.nexcess.com/sites-stores/control-panel/interworx/siteworx/website-management/secondary-domains/).
2. Using SSH, FileZilla, or a similar file-transfer program, copy your website files from your Magento 2 installation to your new secondary domain. SSH is the preferred method, as FTP may take considerable time to copy these files. See [How to set up FileZilla](https://docs.nexcess.com/sites-stores/control-panel/interworx/siteworx/security/ssh-access/) and [How to use FileZilla](https://docs.nexcess.com/sites-stores/control-panel/interworx/siteworx/security/ssh-access/) for more information.
3. Download your live website’s database as a .sql file to your computer. If you are proficient with the command line interface and MySQL, see [How to export tables and import MySQL tables via CLI/SSH](https://www.liquidweb.com/blog/export-tables-and-import-mysql-tables-via-clissh/). If not, use the method provided in [How to import and export MySQL databases in SiteWorx](https://docs.nexcess.com/sites-stores/control-panel/interworx/siteworx/database-management/import-or-export-mariadb-mysql-databases/).
4. Create a new MySQL database, a new user, and to assign that new user to the new database. Refer to [How to create MySQL databases and users with SiteWorx](https://docs.nexcess.com/sites-stores/control-panel/interworx/siteworx/database-management/user-accounts/) for more information.
5. Open this new database in PHPMyAdmin, then import the downloaded .sql file to the dev site database. As in Step 3, see [How to export tables and import MySQL tables via CLI/SSH](https://www.liquidweb.com/blog/export-tables-and-import-mysql-tables-via-clissh/) or [How to import and export MySQL databases in SiteWorx](https://docs.nexcess.com/sites-stores/control-panel/interworx/siteworx/database-management/import-or-export-mariadb-mysql-databases/) for guidance.
6. Change the base URL by opening your newly imported database in PhpMyAdmin, or by accessing via CLI. In the **core\_config\_data** table, update the **web/unsecure/base\_url**, **web/secure/base\_url**, and **design/head/includes** entries with the URL of your dev site. See [How to change base URLs in Magento 2](https://www.liquidweb.com/magento/admin/how-change-base-urls/) for more information.
7. Verify you have updated all URLs searching for %% and update as necessary.
8. Using a text editor, modify the env.php file (under app/etc/env.php) to reflect the new db name, username, and password you created in Step 4.  
    ![](https://docs.nexcess.com/wp-content/uploads/2026/06/1568227455121-1568227455121-1.png)
9. Flush your cache. If using Magento, see [How to flush your Magento cache](https://www.liquidweb.com/magento/admin/how-flush-cache/) for assistance.
