12/28/2021

Install Docker Compose On Linux

37
  1. Welcome to our guide on how to install Docker and Docker Compose on Kali Linux machine. We’ll install the Docker CE (Community Edition) on Kali Linux. Docker is the most popular and widely used container runtime. It enables Developers to package, ship and run their applications in isolated containers.
  2. #pip install docker-compose: installs the docker-compose command; Additionally, you may wish to grant specific users access to Docker commands. This should also grant access to use docker-compose commands. To do this, enter the following: #usermod -aG docker, replacing with the name of the user you want to give permissions to.
  3. Updating freqtrade when using docker-compose is as simple as running the following 2 commands: # Download the latest image docker-compose pull # Restart the image docker-compose up -d. This will first pull the latest image, and will then restart the container with the just pulled version. Check the Changelog.
  4. Installing Docker Compose can be done via PIP or the normal apt-get way. # Install Python 3 and PIP. Sudo apt-get install -y python3 python3-pip pip3 install -user docker-compose # Or install only Docker Compose sudo apt-get install docker-compose.
Compose

This page explains how to run the bot with Docker. It is not meant to work out of the box. You'll still need to read through the documentation and understand how to properly configure it.

How to Install Docker Compose on your Linux Instance September 06 2021 Docker Compose is a tool, that is used to run multi-container Docker applications, with Compose you use a YAML file to configure applications run each container will run a standalone services.

Install Docker¶

Start by downloading and installing Docker CE for your platform:

To simplify running freqtrade, docker-compose should be installed and available to follow the below docker quick start guide.

Freqtrade with docker-compose¶

Freqtrade provides an official Docker image on Dockerhub, as well as a docker-compose file ready for usage.

Note

  • The following section assumes that docker and docker-compose are installed and available to the logged in user.
  • All below commands use relative directories and will have to be executed from the directory containing the docker-compose.yml file.

Docker quick start¶

Create a new directory and place the docker-compose file in this directory.

The above snippet creates a new directory called ft_userdata, downloads the latest compose file and pulls the freqtrade image.The last 2 steps in the snippet create the directory with user_data, as well as (interactively) the default configuration based on your selections.

How to edit the bot configuration?

You can edit the configuration at any time, which is available as user_data/config.json (within the directory ft_userdata) when using the above configuration.

You can also change the both Strategy and commands by editing the command section of your docker-compose.yml file.

Docker

Adding a custom strategy¶

Install Docker Compose On Linux
  1. The configuration is now available as user_data/config.json
  2. Copy a custom strategy to the directory user_data/strategies/
  3. Add the Strategy' class name to the docker-compose.yml file

The SampleStrategy is run by default.

SampleStrategy is just a demo!

The SampleStrategy is there for your reference and give you ideas for your own strategy.Please always backtest your strategy and use dry-run for some time before risking real money!You will find more information about Strategy development in the Strategy documentation.

Once this is done, you're ready to launch the bot in trading mode (Dry-run or Live-trading, depending on your answer to the corresponding question you made above).

Install docker-compose on linux

Default configuration

While the configuration generated will be mostly functional, you will still need to verify that all options correspond to what you want (like Pricing, pairlist, ...) before starting the bot.

Monitoring the bot¶

You can check for running instances with docker-compose ps.This should list the service freqtrade as running. If that's not the case, best check the logs (see next point).

Docker-compose logs¶

Logs will be written to: user_data/logs/freqtrade.log.
You can also check the latest log with the command docker-compose logs -f.

Database¶

The database will be located at: user_data/tradesv3.sqlite

Updating freqtrade with docker-compose¶

Updating freqtrade when using docker-compose is as simple as running the following 2 commands:

This will first pull the latest image, and will then restart the container with the just pulled version.

Check the Changelog

You should always check the changelog for breaking changes / manual interventions required and make sure the bot starts correctly after the update.

Editing the docker-compose file¶

Advanced users may edit the docker-compose file further to include all possible options or arguments.

All freqtrade arguments will be available by running docker-compose run --rm freqtrade <command> <optional arguments>.

docker-compose for trade commands

Trade commands (freqtrade trade <...>) should not be ran via docker-compose run - but should use docker-compose up -d instead.This makes sure that the container is properly started (including port forwardings) and will make sure that the container will restart after a system reboot.If you intend to use freqUI, please also ensure to adjust the configuration accordingly, otherwise the UI will not be available.

docker-compose run --rm

Including --rm will remove the container after completion, and is highly recommended for all modes except trading mode (running with freqtrade trade command).

Example: Download data with docker-compose¶

Download backtesting data for 5 days for the pair ETH/BTC and 1h timeframe from Binance. The data will be stored in the directory user_data/data/ on the host.

Head over to the Data Downloading Documentation for more details on downloading data.

Example: Backtest with docker-compose¶

Run backtesting in docker-containers for SampleStrategy and specified timerange of historical data, on 5m timeframe:

Head over to the Backtesting Documentation to learn more.

Additional dependencies with docker-compose¶

If your strategy requires dependencies not included in the default image - it will be necessary to build the image on your host.For this, please create a Dockerfile containing installation steps for the additional dependencies (have a look at docker/Dockerfile.custom for an example).

You'll then also need to modify the docker-compose.yml file and uncomment the build step, as well as rename the image to avoid naming collisions.

You can then run docker-compose build --pull to build the docker image, and run it using the commands described above.

Install docker-compose on arch linux

Plotting with docker-compose¶

Commands freqtrade plot-profit and freqtrade plot-dataframe (Documentation) are available by changing the image to *_plot in your docker-compose.yml file.You can then use these commands as follows:

The output will be stored in the user_data/plot directory, and can be opened with any modern browser.

Data analysis using docker compose¶

Freqtrade provides a docker-compose file which starts up a jupyter lab server.You can run this server using the following command:

This will create a docker-container running jupyter lab, which will be accessible using https://127.0.0.1:8888/lab.Please use the link that's printed in the console after startup for simplified login.

Since part of this image is built on your machine, it is recommended to rebuild the image from time to time to keep freqtrade (and dependencies) up-to-date.

Troubleshooting¶

Install Docker Compose In Linux

Docker on Windows¶

  • Error: 'Timestamp for this request is outside of the recvWindow.'
    • The market api requests require a synchronized clock but the time in the docker container shifts a bit over time into the past. To fix this issue temporarily you need to run wsl --shutdown and restart docker again (a popup on windows 10 will ask you to do so). A permanent solution is either to host the docker container on a linux host or restart the wsl from time to time with the scheduler.

Warning

Due to the above, we do not recommend the usage of docker on windows for production setups, but only for experimentation, datadownload and backtesting.Best use a linux-VPS for running freqtrade reliably.

Docker is a popular container platform to run virtualized lightweight machines. Here we learn how to install Docker Engine and Compose on Alpine Linux using simple commands to run Containers.

Alpine Linux is popular for its lightweight, security, and performance, hence widely used for installing Docker for creating containers using various Images available on Docker Hub. If you are an Alpine user and want to know how to use this container platform on Linux, here are the steps to follow.

Contents

  • Steps to install Docker Engine & Compose on Alpine Linux

Steps to install Docker Engine & Compose on Alpine Linux

1. Run Alpine update

First, on the command line of this Linux, run the system update command to refresh the repository cache.

2. Install Docker Engine and Compose

The packages to install Docker are already in the repository of Alpine Linux, hence we don’t need to add anything. Just use the APK package manager and install the required packages.

3. Start and enable Docker Service

By default, the Docker service is not activated to run by the system automatically with every boot. Hence we have to do that manually, here are the commands to follow.

4. Add your Alpine user to the Docker group

If you are using any user other than root then you have to use sudo with every command of docker. To remove this inconvenience, you can add your system user to the Docker’s group.

5. Test Docker

Install Docker Compose Linux Mint 20

Now, let’s test whether everything is working absolutely fine and would we be able to create containers or not. To check, here we are downloading the Ubuntu docker image to create a container for that.

Create container:

Start Container:

Docker Compose For Linux

Switch and Access the installed Ubuntu Container root user:

Install Docker-compose On Arch Linux

Stop container:

Remove container

  • Most Viewed News

    • Facebook Download Macbook
    • Download Ultraviewer Mac
    • El Capitan Mac Os X Download