Troubleshooting
Solve the most common problems that occur when using Dokploy.
Applications Domain Not Working?
You see the deployment succeeded, and logs are running, but the domain isn't working? Here's what to check:
-
Correct Port Mapping: Ensure the domain is using the correct port for your application. For example, if you're using Next.js, the port should be
3000
, or for Laravel, it should be8000
. If you change the app port, update the domain to reflect that. -
Avoid Using
Ports
in Advanced Settings: Generally, there's no need to use thePorts
feature unless you want to access your app viaIP:port
. Leaving this feature enabled may interfere with your domain. -
Let's Encrypt Certificates: It's crucial to point the domain to your server's IP before adding it in Dokploy. If the domain is added first, the certificate won't be generated, and you may need to recreate the domain or restart Traefik.
-
Listen on 0.0.0.0, Not 127.0.0.1: If your app is bound to
127.0.0.1
(which is common in Vite apps), switch it to0.0.0.0
to allow external access.
Logs and Monitoring Not Working After Changing Application Placement?
This is expected behavior. If the application is running on a different node (worker), the UI won't have access to logs or monitoring, as they're not on the same node.
Mounts Are Causing My Application Not to Run?
Docker Swarm won't run your application if there are invalid mounts, even if the deployment shows as successful. Double-check your mounts to ensure they are valid or check the General Swarm Section and find your application, and you will see the real error.
Volumes in Docker Compose Not Working?
For Docker Compose, all file mounts defined in the volumes
section will be stored in the files
folder. This is the default directory structure:
I added a volume to my docker compose, but is not finding the volume?
For docker compose all the file mounts you've created in the volumes section will be stored to files folder, this is the default structure of the docker compose.
So instead of using this invalid way to mount a volume:
You should use this format:
Logs Not Loading When Deploying to a Remote Server?
There are a few potential reasons for this:
- Slow Server:: If the server is too slow, it may struggle to handle concurrent requests, leading to SSL handshake errors.
- Insufficient Disk Space: If the server doesn't have enough disk space, the logs may not load.
Docker Compose Domain Not Working?
When adding a domain in your Docker Compose file, it's not necessary to expose the ports directly. Simply specify the port where your app is running. Exposing the ports can lead to conflicts with other applications or ports.
Example of what not to do:
Recommended approach:
This is only valid for Docker Compose not for Docker Stack.
When using Docker Stack, the ports are exposed automatically, so you don't need to specify them explicitly.
Example of what not to do:
Recommended approach:
Then, when creating the domain in Dokploy, specify the service name and port, like this:
- Another reason of the domains are not working it may be because the healthchecks you've defined are not working, so this will cause the domains never work, so you have two options:
- Remove the healthcheck from the service
- Make sure the healthcheck is working
Getting "Bad Gateway Error" When Accessing Your Application Domain
If you're encountering a Bad Gateway Error when accessing your application through its domain, this typically indicates one of several common configuration issues:
Common Causes
- Port Mismatch: The configured port might be incorrect
- Listen Address Configuration: The service might be listening only on
127.0.0.1
instead of0.0.0.0
Common Solution for Modern JavaScript Frameworks
This issue frequently occurs with modern JavaScript frameworks like Vite, Astro, or Vue.js applications. By default, these frameworks often listen only on localhost (127.0.0.1
).
To resolve this, you need to configure your application to listen on all available network interfaces (0.0.0.0
).
Example Configuration for Vite
Here's how to properly configure a Vite application:
Framework-Specific Notes
- Vite Apps: Use the configuration above
- Astro: Similar configuration in
astro.config.mjs
- Vue.js: Configure in
vite.config.js
if using Vite - Other Frameworks: Check your framework's documentation for network interface configuration
Remember to deploy again your application after making these changes for them to take effect.
Docker Compose Volume Mounts
When using Docker Compose, you can configure volume mounts in your docker-compose.yml
file:
Use of closed network when restarting Traefik
If you see this error in the logs of Traefik, it means that the network is being closed, this is the normal behavior when restarting Traefik.
Creating Configuration Files
If you need to create configuration files before deploying your compose setup:
- Go to Advanced -> Mounts
- Create a new File Mount
- Add your configuration content in the content field
- Specify the file path for your configuration
Note: All File Mounts are automatically created in the /files
directory. For example, if you create a file named my-config.json
, it will be available at /files/my-config.json
.
You can then reference this configuration file in your docker-compose.yml
:
Failed to initialize Docker Swarm
Error response from daemon: must specify a listening address because the address to advertise is not recognized as a system address, and a system's IP address to use could not be uniquely identified
This error occurs when the Docker Swarm is not properly initialized.
To fix this, you need to assign a the public IP address to the Docker Swarm, ideally you can use a private IP address from your network, but if you require features from docker swarm, you will need to use a public IP address.
My Dokploy UI Instance is Not Accessible
If you can't access your Dokploy UI instance, there could be several causes. While this issue won't occur with Dokploy Cloud (where our team manages the infrastructure), self-hosted instances might encounter configuration problems.
Let's go through the possible cases where your Dokploy UI instance might be inaccessible:
1. Insufficient Storage Space
If you've made many deployments and don't have available space on your server, the Dokploy database might enter recovery mode, preventing access to the user interface. Here's a quick solution to clear cache and free up server space:
2. Container Race Condition During Restart
During a restart, a race condition might occur where Dokploy's dependent containers don't start in the correct order. To troubleshoot this:
First, verify the running containers:
You should see all four of these containers running:
If all four containers are running but you still can't access the interface, it's time to debug:
Debugging Process
1. Check Container Logs
Start by examining the logs of each container:
2. Common Database Connection Issue
A common case is when the Postgres container starts after the Dokploy container, preventing Dokploy from connecting to the database. You might see logs like this when running docker service logs dokploy
:
To fix this, restart the Dokploy service:
3. Traefik Configuration Issues
If all containers are running but you still can't access the UI, and Dokploy logs show no errors, the Traefik container might have configuration issues.
When running docker logs dokploy-traefik
, you might see errors like:
First, try restarting Traefik:
If you still can't access it and the same error persists in the Traefik logs, you'll need to check the Traefik configuration. In this case, the error indicates that the passHostHeader
field is missing in the configuration.
If you've modified any Traefik configuration for an application
and added invalid configuration, the logs will point to the error. For example, the error above mentions field not found, node: passHostHeader
, which means we need to manually modify the configuration files in /etc/dokploy/traefik
.
Here's an example of an invalid configuration:
The correct configuration should be:
After fixing the configuration, restart Traefik:
You should now be able to access the user interface.
Recreate dokploy containers
In the case you want to recreate the dokploy services, you can do the following:
Remove the dokploy-redis service:
Remove the dokploy-postgres service:
Remove the dokploy-traefik service:
Remove the dokploy service:
Final Notes
While the specific issues may vary, the general troubleshooting approach remains similar to what we've described above, and is the general way we always follow when correcting a problem related to the dokploy instance not starting.. If you still can't access the user interface:
- Check that all containers are running properly
- Review the logs of each container for specific error messages
- Verify all configuration files
- Make sure to read the Traefik documentation for detailed configuration options: https://doc.traefik.io/traefik/
Dokploy Cloud
If you are using Dokploy Cloud, you don't need to worry about this, our team will handle the infrastructure for you.
Start using Dokploy Cloud https://app.dokploy.com/