SiteHost

Managing Volumes

Volumes are a feature designed to allow you to share data between containers. This also allows you to store data outside of your application folder, share data between containers, or provide users with access to specific files.

Creating a Volume

  1. When logged into the Control Panel , click Containers in the left menu.
  2. Click Volumes in the list below Containers to bring you to the Volumes page.
  3. Click Add Volume in the top right.
  4. Choose a name for your volume
  5. Select which server to create the volume on.
  6. Optionally, choose which containers to link the volume to.
  7. Click Add Volume to start the volume creation process.

Connecting and Disconnecting a Volume to a Container

  1. Click on Containers in the left menu.
  2. Click Volumes in the list underneath the Containers option. This will bring you to the Volumes page.
  3. Click on the volume you want to connect to a container. If you do not see it, you may need to swap the server you're currently viewing.
  4. In the Volume Details page, click on the Linked Containers field and select the container(s).
  5. If you wish to disconnect volumes, click the next to the container name in the Linked Containers field.
  6. Click Save Changes

Connecting to a Volume

There are two ways to connect to a volume, both of which are done via SSH and sFTP.

Connecting via a Container

  1. Link a SSH user to a Cloud Container
  2. SSH into the server using the SSH user.
  3. Navigate into the container folder.
    • If you've linked multiple containers to the SSH user, you will need to enter the relevant container's folder.
  4. Enter the volumes folder and find your volume.

Connecting directly to a Volume

  1. Link a SSH user to a Volume
  2. SSH into the server using the SSH user.
  3. Navigate to the volumes folder.

Using a Volume in a Container

When you set up a volume, it exists as an extra directory in your container. By default, it is not set up to serve files on your container.

To allow your website to use the files found within the volume, you will need to make a symbolic link inside the container. Below is a set of instructions to do this:

  1. SSH into your container.
  2. Navigate to the directory where you want your volume to live.
  3. Create a symlink via the command ln -s /container/volumes/[volume-name] [directory name]

For example, if you wished to serve videos on example.com/assets/videos, which are stored on a volume called assets under the videos folder, you would run:

cd /container/application/public
ln -s /container/volumes/assets

This will create a symlink from /container/application/public/assets to /container/volumes/assets, allowing you to serve any files in that volumes on your site.

If you wish to only serve the videos within the assets volume, you can run:

cd /container/application/public
ln -s /container/volumes/assets/videos videos

You cannot use the root (~) of your SSH user in the path! You either need to use a relative path or an absolute path with /container as the root directory.

Accessing Volume Backups

When you SSH into a volume, or a container with a volume attached to it, you'll be able to find the backups in the backups folder.

When your SSH user is connected to a volume (or multiple volumes), this folder will be located in the root directory, alongside the volumes folder.

When your SSH user is connected a container, this folder will be located in the container's files. You will need to navigate into the volumes subdirectory under backups to find the backups for each volume.

Deleting a Volume

To delete a volume, you will need to remove it from all connected containers manually. This can be done by following the instructions above regarding Connecting and Removing a Volume.

Once there are no attached containers, you can delete the volume.

  1. Navigate to the Volumes page.
  2. Click on the volume you wish to delete, or select the three dots on the far right of the volume you wish to delete.
  3. Click "Delete Volume" from the top right, or the drop-down menu.

Make sure there's no data you wish to keep! Deleting the volume means that you'll lose the data of the volume.