
<p>Appwrite comes with a few built-in tools and methods that easily debug and investigate issues on your Appwrite stack environment.</p>

<h2><a href="/docs/debugging#doctorCLI" id="doctorCLI">Doctor CLI &nbsp;<span class="text-fade text-size-small">available from >= v0.7</span></a></h2>

<p>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.</p>

<p>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).</p>

<div class="ide margin-bottom" data-lang="bash" data-lang-label="Bash">
    <pre class="line-numbers"><code class="prism language-bash" data-prism>docker exec appwrite doctor</code></pre>
</div>

<h2><a href="/docs/debugging#logs" id="logs">Logs</a></h2>

<p>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:</p>

<div class="ide margin-bottom" data-lang="bash" data-lang-label="Bash">
    <pre class="line-numbers"><code class="prism language-bash" data-prism>docker ps</code></pre>
</div>

<p>The 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:</p>

<div class="ide margin-bottom" data-lang="bash" data-lang-label="Bash">
    <pre class="line-numbers"><code class="prism language-bash" data-prism>docker logs [CONTAINER-ID]</code></pre>
</div>

<h2><a href="/docs/debugging#statusCodes" id="statusCodes">Status Codes</a></h2>

<p>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.</p>

<p><a href="/docs/response-codes">Learn more about Appwrite status codes</a></p>


<h2><a href="/docs/debugging#devMode" id="devMode">Dev Mode</a></h2>

<p>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 <a href="https://github.com/appwrite/appwrite/issues/new?body=500%20Error" target="_blank" rel="noopener">report it to the Appwrite team</a>.</p>

<p>To change your dev environment, edit your server _APP_ENV environment variable from 'production' to 'development' in your Appwrite docker-compose.yml file located in the `appwrite` directory in the location where you first installed Appwrite.</p>

<div class="ide margin-bottom" data-lang="yaml" data-lang-label="yaml">
    <pre class="line-numbers"><code class="prism language-yaml" data-prism>...
    - influxdb
    - telegraf
environment:
    - _APP_ENV=development
    - _APP_OPENSSL_KEY_V1=your-secret-key
    - _APP_DOMAIN=localhost
...
</code></pre>
</div>

<p>After you completed the change in the docker-compose.yml file, save it and run the following command to restart Appwrite with your new settings:</p>

<div class="ide margin-bottom" data-lang="bash" data-lang-label="Bash">
    <pre class="line-numbers"><code class="prism language-bash" data-prism>docker compose up -d</code></pre>
</div>
