Install AhsayCBS using Docker on Linux
Linux Requirements
- 64-bit version of Ubuntu (Noble 24.04 LTS, Jammy 22.04 LTS or Focal 20.04 LTS)
- Administrative access to install software packages
Consider the following security implications and firewall incompatibilities before installing Docker.
- If using ufw or firewalld to manage firewall settings, when you expose container ports using Docker, these ports bypass the firewall rules. For more information, please refer to Docker and ufw.
- Docker is only compatible with iptables-nft and iptables-legacy. Use iptables or ip6tables to create firewall rule sets and add them to the DOCKER-USER chain, for more information please refer to Packet filtering and firewalls. Firewall rules created with nft are not supported.
Setting up Ubuntu Environment
Before starting the installation, prepare the Ubuntu environment first by running the following commands using the terminal:
-
To update the package list for upgrades and new package installations.
apt-get update -y
-
To install necessary packages for Docker, including certificates, curl, GnuPG, LSB release information and lsof (used to list open files).
sudo apt-get install ca-certificates curl gnupg lsb-release lsof -y
-
To add Docker's official GPG key to ensure authenticity of Docker packages.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
-
To setup a repository for Docker.
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
-
To update the package list again to include the Docker repository.
apt-get update -y
-
To install the Docker Engine, Docker CLI and containerd, which are required for running containers.
apt-get install docker-ce docker-ce-cli containerd.io -y
-
To add the current user to the docker group.
sudo usermod -aG docker <current user>
If the docker group is not created automatically, create the group by running this command:
sudo groupadd docker
Create and Start Containers
Run the following in the terminal:
-
To create the AhsayCBS Docker root folder.
sudo mkdir /usr/local/cbs sudo chown $(id -u):$(id -g) /usr/local/cbs cd /usr/local/cbs
-
To create the AhsayCBS docker with latest release version.
docker run --name <container name> -d -p <optional IP>:<http port>:80 -p <optional IP>:<http port>:443 -v <local user home>:/user -v <local conf folder>:/config -v <local system folder>:/system -v <local log folder>:/logs <AhsayCBS docker hub account>/<project name>:<image tag>
Example:
docker run --name cbs9 -d -p 80:80 -p 443:443 -v ./user:/user -v ./config:/config -v ./system:/system -v ./logs:/logs ahsay/cbs9:latest
Specific release version may also be used (e.g. 9.11.2.0) by replacing "ahsay/cbs9:latest" with the specific version (e.g. ahsay/cbs9:91120)
The local server's folder structure for the above example will automatically create and clone the default configuration if it does not exist, or it will use the existing folder and configuration file.
/usr/local/cbs/config
/usr/local/cbs/logs
/usr/local/cbs/system
/usr/local/cbs/user
To check the Docker status:
docker ps -a
Access AhsayCBS
Access the AhsayCBS web console at https://<your_backup_server>.
Other Functions
Stop and Start Container
Run using the terminal:
docker start <container name>
docker stop <container name>
Recreate the Container
Run using the terminal:
docker stop <container name>
docker rm <container name>
docker run --name <container name> -d -p <optional IP>:<http port>:80 -p <optional IP>:<http port>443 -v <local user home>:/user -v <local conf folder>:/config -v <local system folder>:/system -v <local log folder>:/logs <AhsayCBS docker hub account>/ <project name>:<image tag>
Example:
docker run --name cbs9 -d -p 80:80 -p 443:443 -v ./user:/user -v ./config:/config -v ./system:/system -v ./logs:/logs ahsay/cbs9:latest
Clean Up Docker Environment
If issues are encountered and there is a need to remove all Docker containers and images, run the following commands using the terminal:
docker stop $(docker ps -ag)
docker rm $(docker ps -ag)
docker rmi $(docker images -q)
Upgrade AhsayCBS
Please refer to the upgrade instructions in the previous section.