# Using Staging Environments

Source: https://support.kapsulehost.com/en-us/staging-environments

A staging environment, available for WordPress and WooCommerce sites, is a private copy of your website where you can test changes, updates, or new features without affecting your live site. Once you are happy with the result, you can [push the changes back to production](https://support.kapsulehost.com/en-us/wordpress-staging-workflow).

### What Is a Staging Environment?

Staging gives you a separate, isolated version of your website running on a temporary URL. Visitors to your live site see nothing while you work. This is especially useful before:

- Installing or updating WordPress plugins
- Switching themes
- Making structural changes to your database
- Testing custom code

### Creating a Staging Site in KPanel

1. Log in to KPanel at [kpanel.kapsulehost.com](https://kpanel.kapsulehost.com)
2. Navigate to **Websites** in the left menu
3. Click the website you want to clone
4. In the site's left menu, open **Environment**, then **Staging**
5. Click **Create Staging**

KPanel will copy your files and database to a staging subdomain (for example, `staging.yourdomain.com`). This typically takes one to two minutes depending on your site size.

> **Note:** Staging environments count towards your plan's storage allocation. Large sites may take longer to clone.

### Making Changes on Staging

Once your staging site is ready, you can:

- Access the WordPress admin via the staging URL
- Install plugins, switch themes, or edit files using [SFTP](https://support.kapsulehost.com/en-us/sftp-access)
- Test forms, checkout flows, and custom functionality

The staging environment is password-protected by default so it is not indexed by search engines.

### Pushing Staging to Production

When you are satisfied with your changes:

1. Go to **Websites** in KPanel
2. Open the **Staging** tab for your site
3. Click **Push to Production**
4. Select what to push using the **Files** and **Database** checkboxes (you can check one or both)
5. Confirm the push

> **Warning:** Pushing the database from staging to production will overwrite your live database. Any new orders, comments, or user registrations on the live site since the staging clone was created will be lost. Always take a backup first.

### Taking a Backup Before Pushing

Before pushing staging to production, create a manual backup:

1. Go to **Websites**, select your site, and open the **Backups** tab
2. Click **Create Backup Now**
3. Wait for the backup to complete, then proceed with the push

See [Taking a Backup](https://support.kapsulehost.com/en-us/taking-a-backup) for detailed steps.

### Deleting a Staging Environment

Once you have finished testing and pushed your changes, delete the staging environment to free up storage:

1. Go to the **Staging** tab
2. Click **Delete Staging**
3. Confirm deletion

> **Tip:** Get into the habit of creating a fresh staging clone each time you plan a significant change, rather than keeping a permanent staging site. This ensures your staging environment always reflects the current state of production.
