Deploying Multiwoven on AWS EC2 Using Docker Compose
This guide walks you through setting up Multiwoven, on an AWS EC2 instance using Docker Compose. We’ll cover launching the instance, installing Docker, running Multiwoven with its dependencies, and finally, accessing the Multiwoven UI.
Prerequisites:
- An AWS account with an active EC2 instance (Ubuntu recommended).
- Basic knowledge of Docker, AWS, and command-line tools.
- Docker Compose installed on your local machine.
Note: This guide uses environment variables for sensitive information. Replace the placeholders with your own values before proceeding.
1. EC2 Instance Setup:
-
Launch an EC2 instance: Choose an Ubuntu instance with suitable specifications for your workload.
Security Group Configuration:
- Open port 22 (SSH) for inbound traffic from your IP address.
- Open port 8000 (Multiwoven UI) for inbound traffic from your IP address (optional).
Key Pair: Create a new key pair or use an existing one to connect to your instance.
-
Connect to your instance: Use SSH to connect to your EC2 instance.
Example:
ssh -i /path/to/your-key-pair.pem ubuntu@<your_ec2_public_ip>
Replace /path/to/your-key-pair.pem with the path to your key pair file and <your_ec2_public_ip> with your EC2 instance’s public IP address.
-
Update and upgrade: Run
sudo apt update && sudo apt upgrade -y to ensure your system is up-to-date.
2. Docker and Docker Compose Installation:
- Install Docker: Follow the official Docker installation instructions for Ubuntu: https://docs.docker.com/engine/install/
- Install Docker Compose: Download the latest version from the Docker Compose releases page and place it in a suitable directory (e.g.,
/usr/local/bin/docker-compose). Make the file executable: sudo chmod +x /usr/local/bin/docker-compose.
- Start and enable Docker: Run
sudo systemctl start docker and sudo systemctl enable docker to start Docker and configure it to start automatically on boot.
3. Download Multiwoven docker-compose.yml file and Configure Environment:
- Download the file:
curl -LO https://multiwoven-deployments.s3.amazonaws.com/docker/docker-compose/docker-compose.yaml
- Download the
.env file:
curl -LO https://multiwoven-deployments.s3.amazonaws.com/docker/docker-compose/.env
- Create and Configure
.env File: Rename multiwoven/.env.example to .env. This file holds environment variables for various services. Replace the placeholders with your own values, including:
DB_PASSWORD and DB_USERNAME for your PostgreSQL database
REDIS_PASSWORD for your Redis server
- (Optional) Additional environment variables specific to your Multiwoven configuration
Example .env file:
DB_PASSWORD=your_db_password
DB_USERNAME=your_db_username
REDIS_PASSWORD=your_redis_password
# Modify your Multiwoven-specific environment variables here
4. Run Multiwoven with Docker Compose:
- Start Multiwoven: Navigate to the
multiwoven directory and run docker-compose up -d. This will start all Multiwoven services in the background, including the Multiwoven UI.
5. Accessing Multiwoven UI:
Open your web browser and navigate to http://<your_ec2_public_ip>:8000 (replace <your_ec2_public_ip> with your EC2 instance’s public IP address). You should now see the Multiwoven UI.
6. Stopping Multiwoven:
To stop Multiwoven, navigate to the multiwoven directory and run.
7. Upgrading Multiwoven:
When a new version of Multiwoven is released, you can upgrade the Multiwoven using the following command.
docker-compose pull && docker-compose up -d
Make sure to run the above command from the same directory where the docker-compose.yml file is present.
Additional Notes:
- Depending on your security group configuration, you might need to open port 8000 (Multiwoven UI) for inbound traffic.
- For production deployments, consider using a reverse proxy (e.g., Nginx) and a domain name with SSL/TLS certificates for secure access to the Multiwoven UI.