Skip to content

Xata Agent ‐ Deploy on EC2

Tudor Golubenco edited this page Apr 10, 2025 · 5 revisions

This guide walks you through deploying the Xata Agent on an EC2 instance using Docker.

1. Create an EC2 Instance

  • Open the AWS console and create a new EC2 instance.
  • Name it something like xata-agent.
  • Select Ubuntu as the operating system.
  • Use t2.medium as the instance type (recommended).
  • Set storage to 25GB (recommended).
  • Select or create a key pair for SSH access.
  • Configure VPC and Security Group settings so the instance can access the RDS instances you want to monitor. This depends on your network setup.
  • Click Launch instance.
Screenshot 2025-03-13 at 00 16 52

2. Connect to the Instance

Once the instance is running, connect via SSH:

ssh -i your-key.pem ubuntu@your-ec2-ip

3. Install Docker

Run the following command to install Docker:

sudo snap install docker

4. Clone the Xata Agent Repository

git clone https://github.com/xataio/agent.git
cd agent

5. Configure Environment Variables

Edit the .env.production file and set the public URL to the EC2 instance’s DNS name or IP (port 8080). Also, add at least the OpenAI API key:

# Public URL of the app
PUBLIC_URL=http://<your-ec2-ip>:8080

# LLM API credentials
OPENAI_API_KEY=sk-proj-....
DEEPSEEK_API_KEY=
ANTHROPIC_API_KEY=

6. Start the Agent

Run the following steps:

  • Start a tmux session to keep the process running in the background:

    tmux
  • Start the agent using Docker Compose:

    sudo docker compose up

7. Continue via the web UI

  • Open the public URL (http://<your-ec2-ip>:8080) your browser to continue setup.
  • Give a name to your project.
  • Follow the Onboarding guide in the UI

Clone this wiki locally