Docker

You can easily Dockerize CrossBox instead of installing it on a VPS or a Dedicated server.

mkdir -p /var/crossbox
cd /var/crossbox

Create a Dockerfile

nano Dockerfile

Copy and paste:

FROM ubuntu:latest
MAINTAINER Support "support@crossbox.io"

RUN apt-get clean && apt-get update && apt-get install -y \
    locales \
    language-pack-fi  \
    language-pack-en && \
    export LANGUAGE=en_US.UTF-8 && \
    export LANG=en_US.UTF-8 && \
    export LC_ALL=en_US.UTF-8 && \
    locale-gen en_US.UTF-8 && \
    dpkg-reconfigure locales
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN apt-get install -y git wget net-tools

Run the command

docker build -t crossbox .

Start the container

docker run -t -d -p 25:25 -p 80:80 -p 110:110 -p 143:143 -p 443:443 -p 465:465 -p 587:587 -p 993:993 -p 995:995 -p 3478:3478 -p 5349:5349 -p 49152:65535 -p 49152:65535/udp -p 5000:5000 crossbox

Port mappings above are needed to forward the traffic from your host machine to the Docker container:

  • 25 - SMTP Local Delivery
  • 80 - CrossBox HTTP
  • 110 - POP3
  • 143 - IMAP
  • 443 - CrossBox HTTPS
  • 465 - SMTP Secure
  • 587 - SMTP
  • 993 - IMAP Secure
  • 995 - POP3 Secure
  • 3478 - TURN TCP and UDP
  • 5349 - TURN Secure TCP and UDP
  • 49152:65535 - Port range for TURN UDP RANGE
  • 5000 - CrossBox Installer

Note:
If you plan to use non-default ports, you'll need to make sure that the ones you enter in the command above match with the ones you choose during the CrossBox Installation. Also, these ports must not be already used at your host machine.

443:443 means proxy from port 443 on a host machine to a Docker container where CrossBox is also running on 443.

5000:5000 is needed for the installer and should be removed after you're done with the installation. 

After you run the command, you'll get the long ID, something like:

88982f9169b45259d04eb5df211fff4c3dd57c8a1ea6b60d9020bf7b3bdab105

Use that ID in the command below to enter into the Docker container's command line

docker exec -it 88982f9169b45259d04eb5df211fff4c3dd57c8a1ea6b60d9020bf7b3bdab105 bash

Now when you've entered the shell, run the following commands:

cd /root
sh <(curl https://cdn.crossbox.io/install.sh || wget -O - https://cdn.crossbox.io/install.sh)

The CrossBox Installer will now start, and you can open the given link in the browser to begin the installation.

Follow the instructions on how to set up CrossBox here: https://crossbox.io/documentation/page/quick-installation

After the installation is done type exit to exit the docker container.

Your CrossBox now runs in a container and you can start using it by visiting the URL you've configured during the installation.

To manage the CrossBox Docker container instance you need to enter the command line and you'll be able to run the crossbox command:

https://crossbox.io/documentation/page/command-line-tools