How to Create a WordPress Sandbox with SiteGround

by | Jul 6, 2020 | How-To | 0 comments

If you’re anything like me, and need to test out some tweaks to a website or plugin, you’d prefer a dedicated website to tinker with. In this guide, I will walk through how to create a WordPress sandbox with SiteGround. Sandbox environments are perfect for testing themes, plugins, and configurations. I’m going to assume you have a SiteGround account ready to go. If not, head over to SiteGround’s website to learn how to setup a SiteGround hosting account.

Setting up a Temporary Site Within Siteground

If you’re not logged into SiteGround already, please do so. Once you have, you should see the following screen:

The SiteGround portal homepage

Now, click on the Websites tab on the navigation bar. You will then see a grid of all the websites you’ve created. If you already have sites shown here, you probably know the usual way to create a new website. However, we’re not creating the usual run-of-the-mill website. You want to create a sort of sandbox website to be able to tinker with, right? The next step is standard, click the orange New Website button. After you’re finished creating the WordPress sandbox with SiteGround, you will see the website appear in this list of websites.

List of websites under my SiteGround hosting account

If you’ve added websites to SiteGround before, you’re probably familiar with the following screen.

Add a website page in SiteGround

On the Add New Website screen, click the Select button under the Temporary Domain card. Once you have that selected, you can see that SiteGround will setup a free subdomain for you (which they label a temporary domain name). I already created six temporary websites in the past, so this will be my seventh temporary site (hence, jaredy7.sg-host.com).

Add a website page in SiteGround with the Temporary Domain option selected

Once you’ve verified that everything looks good, you can click the Continue button.

Add new website page in SiteGround showing Start New Website, Migrate Website, and Skip & Create Empty Site buttons

After clicking Continue, you will then see this new screen prompting about whether you want to start a new website, migrate an existing website, or skip and create an empty site. I always click Skip & Create Empty Site, however you can choose the option you prefer. For this guide, we will click Skip & Create Empty Site.

Last prompt for creating a new website with SiteGround showing Finish button

You can click finish and you’re all set now! SiteGround will create your new temporary website. As SiteGround says, this process should take less than two minutes to complete. Feel free to take a coffee break.

Create Your Site notice after clicking Finish button

Once SiteGround is done setting up your website, you should see the following screen.

Success notification after creating SiteGround site

From this screen, you can click the Manage Site button under Go to Site Tools.

Site Tools page of SiteGround

Configuring Your Sandbox Website On SiteGround

Installing an SSL Certificate

When you are creating a WordPress sandbox with SiteGround, you will want to install an SSL certificate. SiteGround makes this very easy. Go to the SSL Manager tab under the Security category on the left sidebar.

SSL Manager page in the Site Tools of SiteGround

Then, click the Select SSL dropdown and select the Let’s Encrypt certificate type. Finally, click Get and SiteGround will install your free SSL certificate.

Install New SSL section on the SSL Manager page

It will take a few minutes for SiteGround to setup your new Let’s Encrypt SSL certificate. Take a coffee break in the meantime.

Installing SSL spinner notification

Once SiteGround is finished installing and configuring your SSL certificate, you will see a notice that your Let’s Encrypt certificate has been installed.

Let's Encrypt certificate installed

To add and configure a database for our new website, click the MySQL tab under the Site drop-down of the left sidebar.

Configuring the Database

As you create a WordPress sandbox with SiteGround, you will need to create a database for WordPress. The process is relatively trivial, there’s just some information you will need to keep track of along the way.

First, click the MySQL tab under the Site category on the left sidebar.

MySQL tab under the Site tab in Site Tools

A new page should appear with the heading MySQL Manager.

MySQL Manager page under Site Tools of SiteGround

The next step is to click the Create Database button. No further action is needed. SiteGround will provide you the database name. We will need this for installing WordPress.

Database created notice

Next, click the Create User button under the creation notification. This will automatically generate a user with a username/password combo.

Database user created notice

Be sure to write down the password as you will need this later.

Next, click on the Manage Access button. A popup will display labeled, Add Database for User. The All Privileges radio button should be selected. Then, click Confirm. The prompt gives the newly created user all privileges to manipulate the new database we created.

Set all privileges on new database user

After clicking Confirm, we should see a success notification that the user access is good to go.

Success notification for setting access privileges for database user

Configuring SFTP

In addition to creating a database, you will also need a way to transfer the WordPress files to your hosting account. We can harness a technology called SSH File Transfer Protocol, more commonly abbreviated SFTP. SFTP works by using SSH (Secure Shell or Secure Socket Shell) to encrypt the transferring of files to the FTP (File Transfer Protocol) server.

To get started configuring SFTP within SiteGround, head over to the SSH Keys Manager page. On the sidebar on the left, find the Devs tab, click it, then click on SSH Keys Manager.

SSH Keys Manager page of SiteGround's site tools.

You will need to generate a new SSH key. It’s very easy, all you have to do is enter a key name and password. Do so, then click the Create button.

New SSH key generated notification

There’s some information you will need about your newly created SSH key for later on. Click the three dots next to the SSH key, and select the SSH Credentials option in the drop-down.

View SSH Credentials for the new key by clicking the three dots next to the entry and clicking "SSH Credentials"
Popup window showing the SSH credentials for the newly made key

The information you will need will appear in a popup window like the one above.

Be sure you write down your hostname, username, password, and port. You will need this when you copy over WordPress below.

You will also need to copy the private key of the SSH key you created. Click the three dots next to the key. On the drop-down, click the Private Key option.

View the private key by clicking the three dots next to the key entry and clicking "Private Key" on the drop-down.
Popup window showing the private key for the new SSH key

A dialog will appear with the text of the private key. You will need to copy that text. Conveniently, there is a Copy to Clipboard button which will take care of this for you. At this point, you are ready to continue following the steps below.

Copying WordPress Files via SFTP

The next step to setup a WordPress sandbox with SiteGround is to copy all of the WordPress files to our new website. We will utilize SFTP (File Transfer Protocol) for this. SFTP allows you to add, remove, and edit the files of your website. First, you will need an FTP client in order to harness this protocol. Most FTP clients will be compatible with SFTP.

FileZilla

If you’re looking for an FTP client, I would recommend FileZilla. FileZilla is a popular free and open source FTP client. For this guide, I will be using FileZilla. If you’re using it too, I will be walking through how to use it when copying the WordPress files.

The first step you need to take is creating a file in a safe place to paste our private key into. Feel free to name this file anything, however it should have a .ppk extension. Next, you will need paste all of the text in the private key box from the last step into the new file.

The private key copied into a new file

You should see a prompt appear asking if you would like to convert the key file to a supported format.

FileZilla prompt asking if you want to convert the key file into a supported format
Password prompt from FileZilla asking for the password for your SSH key
Save file dialog window prompting where you want to save the new key that has been converted to a compatible format

Save this new key file (compatible with FileZilla) in a safe location. I stored mine with my existing key file that I made earlier.

FileZilla settings window under the SFTP settings with the new key file added

Your key file is now registered in FileZilla. Be sure to click the OK button under the left sidebar of the settings window to save changes.

Find the Site Manager button and click it. It should be in the top left corner of the main FileZilla window.

The FileZilla window showing how to access the Site Manager
The Site Manager window of FileZilla

Once Site Manager opens, click the New Site button on the left. This will create a new entry for the newly setup SiteGround site. You will be able to easily connect to your website via FTP without typing in the credentials every time by adding this entry.

You will need to enter the host, port, SSH key user name, and SSH key user password that you’ve gathered previously. The fields are relatively self explanatory, just put the corresponding value in each of the fields. Ensure the Logon Type is set to Normal.

The Site Manager window in FileZilla with a new site entry added with the credentials filled out that you have from SiteGround

Once you’ve added the connection details for the site, you can click OK to save them.

Feel free to rename your Site Manager entry. You can do so by double-clicking the New Site entry in the sidebar and entering a new name. When you’re all set, just press enter to save the new name.

At this point, you should be ready to connect to your website via SFTP.

You will be prompted to enter the password for the SSH key before you can connect to your website.

Another FileZilla password prompt for the SSH key password

Once validated, FileZilla will be connected to your website!

Connection test to the new temporary website using SFTP

Next, click the Add Key File button. A file browser will open, then navigate to where you saved the private key file. Once you select the file and open it, you will probably receive a dialog asking if you would like to convert the file to a supported format. Select Yes, and another file dialog will appear.

Downloading WordPress

Next, the files for WordPress need to be downloaded. Head over to WordPress.org and click the blue Download WordPress <current version number> button. As of the time of writing this, WordPress is on version 5.4.2.

The WordPress download page

Once the WordPress ZIP folder has downloaded, extract it. The easiest way to transfer the WordPress files at this point is to move a file browser window next to FileZilla. Reconnect to your website by clicking the down arrow next to the Site Manager button, then click your Site Manager entry. After a few seconds, you should see the root directory of your site appear on the right side of FileZilla.

Extracted WordPress files window on the left side with FileZilla connected to the new SiteGround site on the right side

You can’t just drop the WordPress files anywhere though. First, double click the www directory, then you should see another folder with the name of your domain. Double-click this folder.

The domain folder of the new SiteGround website

Then you should see three more folders appear. Double-click the public_html folder. This is the actual folder where your website files are stored.

List of directories that include logs, public_html and webstats

Now you should just see a single file, Default.html. You will want to delete this file, it’s just a default placeholder. We will be dumping the WordPress files here instead.

File and directory list that includes a single Default.html file

Select all of the WordPress files from the extracted folder and click and drag the files to the right side of FileZilla where it says Empty directory listing.

All WordPress files highlighted in the folder window on the left side with FileZilla pointed inside the public_html directory

You will know that the WordPress files have finished transferring once you see no queued files. If everything went smoothly, there shouldn’t be any failed transfers.

Screenshot showing no queued files, no failed transfers and 1905 successful transfers

No matter if you are setting up a WordPress sandbox with SiteGround or another host, the next step is to install WordPress. Open your browser and navigate to your temporary domain, but make sure it’s prefixed with https://. Be sure that you see a green lock next to the website address to make sure the installation process is secure.

If you’re using Chrome, you should see the website address look like the following:

SSL indicator next to website address using Chrome

Or if you’re using Firefox, it should look very similar:

SSL indicator next to website address using Firefox

Once you’ve checked for the green lock, ensure that you’re seeing the same page as the one below. If you are, select your language and click Continue.

The first step of the WordPress installer, prompting for a language

The next screen is just informing you that you need your database credentials before proceeding. You should have these from the steps you’ve taken earlier. After you have your database credentials on hand, click Let’s go!.

WordPress installation notice informing that you need your database credentials from SiteGround

You will see a screen prompting you for your database credentials. Enter them for each of the fields and click Submit.

Next page of the WordPress installation prompting for the database credentials you should have from SiteGround

If all of the credentials were accepted, you should see the following notice that WordPress is ready to be installed. Click the Run the installation button. There is still some information WordPress still needs such as your website name and the username and password for your administrator account.

WordPress notice informing you that a database connection was successful

You should now see the following screen prompting for your website title and username, password, and email for your administrator account. I would recommend enabling the Discourage search engines from indexing this site checkbox since this website will be a sandbox for you.

Final installation page asking for website details for the site title, username, password, email, and search engine visibility

After you filled in all the information, click Install WordPress. The installation is very quick, it only takes a few seconds. WordPress will then inform you that the installation was successful. Click the Log In button to log in to your new WordPress site!

Installation success notice from WordPress

Enter the username and password you just entered above to log into your site, then click the Log In button.

Login screen for WordPress

If your credentials are correct, the WordPress dashboard for your sandbox site should appear!

The WordPress dashboard

Final Thoughts

You now have created a WordPress sandbox with SiteGround, perfect for testing themes, plugins, and configurations. Whether you’re a website designer or developer, it’s useful to know how to setup a test website on a live environment. Do you still need help creating a WordPress sandbox with SiteGround? Please contact us and we would be glad to consult with you to help setup the perfect testing environment.