Assuming you have connected to your instance and ready to execute following steps. First you need to create erxes user
because all erxes related installation scripts are made for erxes user.
Why?
You don't want to use root user to administer your server. So everything will be done by a user called, erxes
. To accomplish this, run the following command:
When prompted, enter unique & strong password. (Finish adding the user simply by pressing the enter or return key through the questions) Grant sudo and docker rights to erxes user by following command:
Now you need to initiate docker swarm mode in order to do that use following command.
Note
If you get a permission denied warning when you run this command, you haven't run the usermod -aG docker erxes command.
Note
In erxes directory we have docker-compose.yml file even with that we do not use docker-compose up, docker-compose down, docker-compose restart commands further
To check database services up use following command it will shows you all the running docker services id, name and state etc.
Now we need to make our mongo have a replica set. First we need to enter the mongo container then enter the mongo instance then execute the 3 following commands.
Note
You may want to hit return or enter button a few times, if we have done it correctly mongo shell will changes into "RS0: primary"
To quit mongo instance and container run exit command twice.
Now we need to generate docker-compose.yml file.
Note
If you are using plugin and you need to add environment variables to the docker-compose.yml file, you can add them in the docker-compose.yml file.
To check erxes services up use following command it will shows you all the running docker services id, name and state etc.
Now we need to configure the erxes.
Note
Replace example.com with your domain name.
After that we need to test the nginx config. To do that use following command.
If nginx test shows successful message we need to restart Nginx. To do that use the following command.
erxes only works in secure connection to generate free ssl certificate we use Certbot. To configure that use the following command.
Note
You have to point your domain's A record to your erxes host machine in order to get certificate without that certbot will not generate certificate order.
After entering this command, provide your email and subscription information, and accept the terms. Following that, you will be prompted about the 'redirect' option. We highly recommend enabling this option for security reasons. Once these steps are completed, open your browser and enjoy our product.
First, it is unfortunate, but every server needs to be kept tidy. The following commands will help remove the Docker stack and any dangling containers in the swarm.
To remove the erxes docker stack, use the following command.
List and remove all dangling images.
List and remove all dangling containers.
List and remove all dangling volumes
List and remove all dangling networks