Quickstarts

Outpost Quickstart: Docker with RabbitMQ or AWS SQS via LocalStack

Local Docker setup for Outpost using Docker Compose. This setup includes:

  • Outpost services (API, delivery, and log processors). See the architecture for more details.
  • Redis as KV and entity storage
  • PostgreSQL as log storage
  • RabbitMQ or AWS SQS via LocalStack for message queuing

Prerequisites

Setup

  1. Clone the Outpost repo:

    git clone https://github.com/hookdeck/outpost.git
    sh
  2. Navigate to outpost/examples/docker-compose/:

    cd outpost/examples/docker-compose/
    sh
  3. Create a .env file from the top-level example file:

cp .env.example .env
sh
  1. Update the $API_KEY value within the new .env file.

  2. There are two options to run Outpost locally for this quickstart. Choose one of the following:

    1. With RabbitMQ:
    docker-compose -f compose.yml -f compose-rabbitmq.yml -f compose-postgres.yml up
    sh
    1. With SQS via LocalStack:
    docker-compose -f compose.yml -f compose-awssqs.yml -f compose-postgres.yml up
    sh

Verify Installation

  1. Check that the services are running:

    curl localhost:3333/api/v1/healthz
    sh

    Wait until you get an OK response.

  2. Create a tenant with the following command, replacing $TENANT_ID with a unique identifier such as "your_org_name", and the $API_KEY with the value you set in your .env:

    You can use shell variables to store the tenant ID and API key for easier use in the following commands:

    TENANT_ID=your_org_name API_KEY=your_api_key URL=your_webhook_url
    sh
    curl --location --request PUT "localhost:3333/api/v1/$TENANT_ID" \ --header "Authorization: Bearer $API_KEY"
    sh
  3. Run a local server exposed via a localtunnel or use a hosted service such as the Hookdeck Console to capture webhook events.

  4. Create a webhook destination where events will be delivered to using the following command. Again, replace $TENANT_ID and $API_KEY. Also, replace $URL with the webhook destination's URL:

    curl --location "localhost:3333/api/v1/$TENANT_ID/destinations" \ --header "Content-Type: application/json" \ --header "Authorization: Bearer $API_KEY" \ --data '{ "type": "webhook", "topics": ["*"], "config": { "url": "'"$URL"'" } }'
    sh
  5. Publish an event, remembering to replace $API_KEY and $TENANT_ID:

    curl --location "localhost:3333/api/v1/publish" \ --header "Content-Type: application/json" \ --header "Authorization: Bearer $API_KEY" \ --data '{ "tenant_id": "'"$TENANT_ID"'", "topic": "user.created", "eligible_for_retry": true, "metadata": { "meta": "data" }, "data": { "user_id": "userid" } }'
    sh
  6. Check the logs on your server or your webhook capture tool for the delivered event.

  7. Get an Outpost portal link for the tenant:

    curl "localhost:3333/api/v1/$TENANT_ID/portal" \ --header "Authorization: Bearer $API_KEY"
    sh

    The response will look something like the following:

    { "redirect_url": "http://localhost:3333?token=$TOKEN" }
    json

    The token value is an API-generated JWT.

    Open the redirect_url link to view the Outpost portal.

    Outpost portal home page

Continue to use the Outpost API or the Outpost portal to add and test more destinations.