Overview
Blnk Cloud requires a running Blnk Core instance to work. You can host your own Core instance or deploy a managed Core instance from Blnk. For self-hosted instances, Blnk uses a Query Agent to establish a connection between your Core instance and Blnk Cloud. The Query Agent is packaged in a docker container that you run on your machine or infrastructure.
- Enhanced security: No need to expose database credentials or configure complex firewall rules.
- Read-only access: Agent only requires SELECT permissions, ensuring data integrity.
- Simplified setup: Eliminates network configuration complexity.
- Reliable connection: Automatic reconnection and health monitoring.
Connect your self-hosted Core
1
Create an instance on Cloud
- In your Blnk Cloud workspace, go to Settings > Instances;
- Click Connect new instance;
- You’ll see the instance creation form.
2
Provide instance details
Fill in your instance information:Once done, submit the form.
- Instance name: Choose a descriptive name (e.g., “Production”, “Staging”). This is the only required field;
- Core URL: Your Blnk Core instance URL (e.g., https://api.yourcompany.com);
- Core secret key: Your Blnk Core API secret key set in your
blnk.json
configuration file. You can leave this empty if you don’t have a secret key.
We use your Core URL and secret key to process actions in your workspace. Without them, your instance will be limited to read-only access.
3
Set up the Query Agent
After successfully creating your instance, Blnk generates a secure connection key to connect with your Query Agent.Next, you run the docker command to set up your Query Agent.
Replace the placeholder database URL with your actual connection string. The connection key is automatically generated and included in the command.
bash
The container name is generated automatically and is unique to your instance.
4
Verify connection
Return to your Blnk Cloud workspace:
- Check connection status: Navigate back to Settings > Instances;
- Verify agent status: Your instance should show as “Connected” with a green indicator.
Managing your Query Agent
Monitor connection health
To see how your connection is doing:bash
Update the Query Agent
To upgrade the Query Agent to the latest version:bash
Stop the Query Agent
To terminate your Query Agent:bash
FAQs
Trouble connecting to your database locally?
- If you’re running PostgreSQL inside Docker, use
host.docker.internal
as the host in your database URL.- If you’re running PostgreSQL directly on your machine, use
localhost
as the host in your database URL.- Ensure PostgreSQL is running and accessible.
- Check that the port (default: 5432) is correct.
- Verify your database credentials are correct.
Database connection failed?
- Verify the database URL format is correct.
- Ensure the database host is accessible from your Docker host.
- Check that the database user has proper read permissions.
- Verify network connectivity allows database connections.
- Ensure SSL mode is correctly configured.
Docker container won’t start
- Verify Docker is running:
docker --version
- Check if port conflicts exist:
docker ps
- Ensure environment variables are properly formatted.
- Review Docker logs:
docker logs blnk-agent --tail 50
Instance authentication failed
- Verify the instance URL is accessible and responding.
- Verify the instance secret key is correctly copied.
- Ensure SSL certificate is valid if using HTTPS.
- Confirm the instance is running and accepting connections.
- Test instance connectivity:
curl -H "Authorization: Bearer YOUR_SECRET_KEY" https://your-instance-url/health