Debug_
Master debugging techniques for self-hosted Appwrite. Discover best practices and tools for troubleshooting and maintaining a robust deployment.
2 min read
Appwrite comes with a few built-in tools and methods that easily debug and investigate issues on your Appwrite stack environment.
Doctor CLI
The doctor CLI helps you validate your server health and best practices. Using the Doctor CLI, you can verify your server configuration for best practices, validate your Appwrite stack connectivity and storage read and write access, and available storage space.
To run the Doctor check, simply run the following command from your terminal. You might need to replace 'appwrite' with your Appwrite Docker container ID. To find out what's your container ID, you can run docker ps command (more on that, in the next section).
docker exec appwrite doctorLogs
Checking your Appwrite containers can be a great way to pinpoint where and what exactly happens inside your Appwrite services. You can list your Appwrite containers using the following command in your terminal:
docker psThe output of this command will show you a list of all your running Docker containers, their ID's, uptime, and open ports. You can use each container ID to get a list of all the container stdout and stderr logs by using the following command:
docker logs [CONTAINER-ID]Status codes
Appwrite uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, invalid input, etc.). Codes in the 5xx range indicate an error with the Appwrite server, but these are rare.
Development mode
When moving to dev mode, your server will produce much more verbose error messages. Instead of getting a general 500 error, you'll be able to view the exact error that happened on the server, debug the issue further or report it to the Appwrite team.
To change your dev environment, edit your server _APP_ENV environment variable from 'production' to 'development' in your .env file located in the appwrite directory in the location where you first installed Appwrite.
_APP_ENV=development_APP_OPENSSL_KEY_V1=your-secret-key_APP_DOMAIN=localhostAfter editing your docker-compose.yml or .env files, you will need to recreate your Appwrite stack by running the following compose command in your terminal.
docker compose up -dYou can verify if the changes have been successfully applied by running this command:
docker compose exec appwrite varsWas this page helpful?
Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.