# How to deploy directus project correctly?

**URL:** <https://community.directus.com/t/how-to-deploy-directus-project-correctly/1177>\
**Category:** Help\
**Tags:** authentication\
**Created:** [September 16, 2025, 10:51pm UTC](https://community.directus.com/t/how-to-deploy-directus-project-correctly/1177 "2025-09-16T22:51:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![devpapi0891](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/devpapi0891/32/315_2.png) [@devpapi0891](https://community.directus.com/u/devpapi0891)\
**Post date:** [September 16, 2025, 10:51pm UTC](https://community.directus.com/t/how-to-deploy-directus-project-correctly/1177/1 "2025-09-16T22:51:25Z")

</div>

I am trying to deploy my project on my Ubuntu server. After my setups, the directus is accessible but the problem is I cannot login. Here is what I have on docker-compose.yml

```yaml

```

directus:

```
container_name: project-directus

image: directus/directus:11.5.1

restart: unless-stopped

#network_mode: host

ports:

  - 8055:8055

volumes:

  - ./database:/directus/database

  - ./uploads:/directus/uploads

  - ./extensions:/directus/extensions

environment:

  SECRET: ${DIRECTUS_SECRET}

  ADMIN_EMAIL: ${DIRECTUS_ADMIN_EMAIL}

  ADMIN_PASSWORD: ${DIRECTUS_ADMIN_PASSWORD}

  DB_CLIENT: ${DIRECTUS_DB_CLIENT}

  DB_FILENAME: ${DIRECTUS_DB_FILENAME}

  WEBSOCKETS_ENABLED: ${DIRECTUS_WEBSOCKETS_ENABLED}

mem_limit: 400m # cap at \~40% of RAM

cpus: 0.5 # cap at half of 1 vCPU

```

and in my apache configuration, this is what I have:

```xml
<VirtualHost *:80>
    ServerName directus.domain.com

    # Preserve original host and forward headers
    ProxyPreserveHost On
    RequestHeader set X-Forwarded-Proto "https"
    RequestHeader set X-Forwarded-Host "directus.domain.com"

    ProxyPass / http://xxx.xx.xxx.xx:8055/
    ProxyPassReverse / http://xxx.xx.xxx.xx:8055/

    ErrorLog ${APACHE_LOG_DIR}/directus-error.log
    CustomLog ${APACHE_LOG_DIR}/directus-access.log combined
</VirtualHost>

```

This is the erros I saw in browser console when project was accessed

 ![image](https://us1.discourse-cdn.com/flex002/uploads/directus/original/1X/60cfc927435825dd96d5ee22ba07e9e0e7d6cfde.png)

I tested some public api routes like /assets/{id} and it is accessbile.

---

<div class="post-metadata">

**Author:** ![rijkvanzanten](https://sea2.discourse-cdn.com/flex002/user_avatar/community.directus.com/rijkvanzanten/32/31_2.png) [@rijkvanzanten](https://community.directus.com/u/rijkvanzanten)\
**Post date:** [October 3, 2025, 9:17pm UTC](https://community.directus.com/t/how-to-deploy-directus-project-correctly/1177/2 "2025-10-03T21:17:26Z")

</div>

I would highly recommend going with something like Railway or DigitalOcean App Platform in 2025. A lot easier than trying to maintain a VPS with a custom apache config etc etc.

I’ll mark this as solved as you found the root problem already in the comment above 🙏
