Skip to content

Storage

Disk layout

Most of the Cloudron code and data is sandboxed in /home/yellowtent (For the curious, yellowtent was the code name for Cloudron). The subdirectories are:

  • box - This contains the Cloudron code. The Cloudron code does not run as root.
  • boxdata - This contains data that is generated by the Cloudron code including certs. This also contains all user emails in the mail/vmail directory in the maildir format.
  • appsdata - This contains the data generated by each app. Each directory here corresponds to the application id.
  • platformdata - This contains 'runtime' data of the platform for mysql, postgres, mongodb, nginx.

boxdata, appsdata and platformdata are relocatable.

The other important locations on the server are:

  • /var/lib/docker - This contains docker images. This is relocatable.
  • /etc/nginx - These contains the reverse proxy configuration. It is not meant to be edited manually.
  • /apps.swap - This is a swap file that is dynamically resized by Cloudron. It will be no more than 4GB.

Docker image location

Cloudron uses Docker for containerizing applications and docker images tend to consume a lot of space. The docker images are stored by default at /var/lib/docker. They can be moved to an external storage as follows:

  • Stop docker
systemctl stop docker
  • Move existing contents to external storage. Any external storage must be formatted as ext4. Assuming, /mnt/docker is the new location:
rsync -aHSX /var/lib/docker /mnt/docker
  • Change docker image location to /var/lib/docker by creating a systemd drop-in /etc/systemd/system/docker.service.d/custom.conf with the following contents:
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// --log-driver=journald --exec-opt native.cgroupdriver=cgroupfs --storage-driver=overlay2 --graph=/mnt/docker

Alternately, you can bind mount mount --bind /mnt/docker /var/lib/docker. This, however, requires adding an entry in /etc/fstab to persist across reboots.

  • Start docker
systemctl daemon-reload
systemctl start docker
systemctl status docker
rm -rf /var/lib/docker

Docker image size

The du -hcs /var/lib/docker command will often return incorrect output with the overlay2 driver because of how du works. Use docker system df instead to determine the size

Docker storage driver

Cloudron apps are only tested using the overlay2 graph driver. Other storage drivers are not tested. In the past, we have seen some apps to not work correctly with storage drivers like devicemapper.

Moving a single app's data directory to another location

Please make sure you have a complete backup before following the procedure below.

Apps store their data and assets in the /home/yellowtent/appsdata/<appid> directory. If the server is running out of disk space (in the root filesystem), you can move the app's storage directory to another location. In most cases, this is an external disk mounted on the server. For example, you can mount a DigitalOcean Block Storage or AWS Block Store and move the app's data to that disk.

For example, to move an app's data to an external disk location like /mnt/nextcloud, go to the Resources section:

Move the data directory to another location

Please make sure you have a complete backup before following the procedure below.

Apps store their data under /home/yellowtent/appsdata. Cloudron itself stores it's data (users, groups, certs, mails etc) under /home/yellowtent/boxdata.

If the server is running out of disk space, one or more of these directories can be moved to another ext4 disk/location as follows:

    systemctl stop cloudron.target
    systemctl stop docker
    DATA_DIR="/var/data"  # this is the external disk location
    mkdir -p "${DATA_DIR}"

    # (optional) move out apps data to the external disk
    mv /home/yellowtent/appsdata "${DATA_DIR}"
    ln -s "${DATA_DIR}/appsdata" /home/yellowtent/appsdata

    # (optional) move out box data to the external disk
    mv /home/yellowtent/boxdata "${DATA_DIR}"
    ln -s "${DATA_DIR}/boxdata " /home/yellowtent/boxdata

    # (optional) move out app database storage to the external disk
    mv /home/yellowtent/platformdata "${DATA_DIR}"
    ln -s "${DATA_DIR}/platformdata" /home/yellowtent/platformdata

    systemctl start docker
    systemctl start cloudron.target

If the disk graph does not display properly, do a systemctl restart collectd.

Note: data directory must be an ext4 filesystem.

Resizing the server

For VPS providers that support it, the server (cpu/disk/memory) can be resized and Cloudron will automatically adapt to the available resources after a server restart.

IP changes

Some VPS providers change the IP address of the virtual machine after a resize. You will have to change the IP address in your DNS, if this is the case.

AWS EBS

On AWS, the partition and the filesystem must be resized after resizing the EBS volume. This can be done by following the AWS Guide.