How to Install Firecrawl on Ubuntu 24.04

Step 1: Update the server

apt update && apt upgrade -y
reboot

Reconnect after the reboot.

Step 2: Install Docker

apt install -y ca-certificates curl gnupg lsb-release

mkdir -p /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
  | gpg --dearmor -o /etc/apt/keyrings/docker.gpg

echo \
  "deb [arch=$(dpkg --print-architecture) \
  signed-by=/etc/apt/keyrings/docker.gpg] \
  https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" \
  | tee /etc/apt/sources.list.d/docker.list > /dev/null

apt update

apt install -y docker-ce docker-ce-cli containerd.io \
docker-buildx-plugin docker-compose-plugin

systemctl enable docker
systemctl start docker

Verify the installation:

docker --version
docker compose version

Step 3: Create Firecrawl Directory

mkdir -p /opt/firecrawl
cd /opt/firecrawl

Step 4: Download Firecrawl

git clone https://github.com/firecrawl/firecrawl.git
cd firecrawl

Step 5: Create Environment File

Copy the example environment file:

cp apps/api/.env.example .env

Edit the file:

nano .env

At minimum, configure the following values:

USE_DB_AUTHENTICATION=false
BULL_AUTH_KEY=change_this_to_random_string

Note : Replace "change_this_to_random_string" with your original BULL_AUTH_KEY , this can be generated using cmd openssl rand -hex 32

For production deployments, use strong secrets and database passwords.

Step 6: Start Firecrawl

Start the containers:

docker compose up -d

Or build locally before starting:

docker compose build
docker compose up -d

Step 7: Verify Containers

Check the running containers:

docker ps

You should see containers similar to:

firecrawl-api
playwright-service
redis
rabbitmq
postgres

Step 8: Test Firecrawl

Check if the API is responding:

curl http://localhost:3002

Or access it in a browser:

http://YOUR_SERVER_IP:3002

Test a crawl request:

curl -X POST http://localhost:3002/v1/crawl \
  -H "Content-Type: application/json" \
  -d '{
    "url":"https://firecrawl.dev"
  }'

A successful response indicates Firecrawl is working correctly.

Output:

{"message":"Firecrawl API","documentation_url":"https://docs.firecrawl.dev"}

Step 9: Configure Nginx Reverse Proxy (Optional)

Install Nginx:

apt install nginx -y

Create the configuration file:

nano /etc/nginx/sites-available/firecrawl.conf

Add the following configuration:

server {
    server_name crawl.example.com;

    location / {
        proxy_pass http://127.0.0.1:3002;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Enable the site:

ln -s /etc/nginx/sites-available/firecrawl.conf \
/etc/nginx/sites-enabled/

nginx -t
systemctl reload nginx

Install SSL using Certbot:

apt install certbot python3-certbot-nginx -y

certbot --nginx -d crawl.example.com

Useful Commands

View logs:

docker compose logs -f

Restart services:

docker compose restart

Stop services:

docker compose down

Update Firecrawl:

git pull
docker compose pull
docker compose up -d

CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS