Installation¤
Hardware requirements¤
Minitrade is designed to operate efficiently on resource-constrained environments, such as AWS Lightsail instances with modest specifications: 1 GB RAM, 1 vCPU, and 40 GB SSD, which typically cost $5 per month. To optimize performance on such machines, it is advisable to allocate an additional 1 GB of swap space. Detailed instructions for adding swap space on Ubuntu 20.04, or similar operating systems, can be found in this guide.
Security recommendations¤
Ensuring server access security is paramount, especially considering the sensitive broker credentials stored locally. Here are key security recommendations:
- Dedicated Server: Employ a dedicated server exclusively for Minitrade operations to mitigate risks associated with mixed-purpose instances.
- Secure Remote Access: Use OpenVPN or similar technology for secure remote server access, safeguarding against unauthorized entry.
- Firewall Configuration: Configure firewall rules to permit only SSH and OpenVPN connections. Utilize firewall rules to block remote access to the Minitrade web UI and IB gateway, only allow local access to the web UI via a private IP address over OpenVPN connection.
- Dedicated IB User: Establish a dedicated IB user for Minitrade. This user should be granted only essential trading access while disallowing other privileges to prevent conflicts and minimize account permissions.
Try in docker¤
While running Minitrade within a Docker container is generally discouraged due to resource utilization and management complexities, it can serve as a viable option for experimentation. If you opt to proceed with this approach, adhere to the following steps:
- Build Docker Image: Begin by constructing a Docker image using the provided Dockerfile.
- Port Exposure: Ensure port 8501 is exposed to facilitate access to the web UI.
- Platform Compatibility: Note that the Docker image has been primarily tested on Linux hosts. It may encounter compatibility issues on Mac systems equipped with M1/M2 chips, particularly due to Chrome compatibility concerns.
- Configuration Modifications: Should modifications be made to the telegram or email settings, it's imperative to restart the container to enact these changes effectively.
Install on Ubuntu 20.04¤
-
Install OpenVPN: Follow the instructions provided here to set up OpenVPN. Ensure that the firewall allows traffic on the port OpenVPN listens on.
-
Install pyenv: Refer to the instructions outlined here to install pyenv. Once installed, proceed to install Python 3.10:
-
Install Dependencies:
-
Install Minitrade:
Install on Ubuntu 22.04¤
-
Install OpenVPN: Follow the instructions provided here to set up OpenVPN. Ensure that the firewall allows traffic on the port OpenVPN listens on.
-
Install Python 3.10:
-
Install Dependencies:
-
Install Minitrade:
Launch Minitrade¤
Launching Minitrade involves starting all three processes:
# Start the scheduler
minitrade scheduler start
# Start IB Gateway
minitrade ib start
# Start the web UI
minitrade web start
For long-term process management, consider using a process monitor like Supervisor. Alternatively, you can use this script for a quick and simple launch.