help deploying mautic
gritoweb
HOBBYOP

21 days ago

I am trying to install the mautic-railway project on the Railway platform, available at the following repository:
https://github.com/Shinyduo/mautic-railway/

I followed the instructions provided in the repository, but I am running into issues during the deploy/configuration process and I am unable to complete the installation successfully.

Could you please help me with:

  • The correct way to configure this project on Railway

  • Required environment variables

  • Any Railway-specific adjustments needed for this type of application (Mautic + Docker)

If needed, I can provide logs, screenshots, or more details about the errors I’m encountering.

Thank you in advance for your support.

Best regards,

This logs build

[Region: us-east4]

=========================

Using Detected Dockerfile

=========================

context: sbxw-iaqA

internal

load build definition from Dockerfile

0ms

internal

load metadata for docker.io/mautic/mautic:latest

124ms

auth

mautic/mautic:pull token for registry-1.docker.io

0ms

internal

load .dockerignore

0ms

1

FROM docker.io/mautic/mautic:latest@sha256:13ea767ba4b88a37f5b942097b00dca6e3b7fd6cb4a9a048a42208e97eee6dd3 cached

8ms

auth

sharing credentials for production-us-east4-eqdc4a.railway-registry.com

0ms

importing to docker

31s

Build time: 35.47 seconds

this logs deploy

Error: /var/www/html/var/logs does not exist or is not a directory.

----- Startup Checks Error Found -----

Please ensure the volume(s) is mounted correctly and is accessible.

If you are running this container as a non-root user, you may need to run the container with elevated privileges.

Error: /var/www/html/var/logs does not exist or is not a directory.

----- Startup Checks Error Found -----

Please ensure the volume(s) is mounted correctly and is accessible.

If you are running this container as a non-root user, you may need to run the container with elevated privileges.

Error: /var/www/html/var/logs does not exist or is not a directory.

----- Startup Checks Error Found -----

Please ensure the volume(s) is mounted correctly and is accessible.

If you are running this container as a non-root user, you may need to run the container with elevated privileges.

Error: /var/www/html/var/logs does not exist or is not a directory.

----- Startup Checks Error Found -----

Please ensure the volume(s) is mounted correctly and is accessible.

If you are running this container as a non-root user, you may need to run the container with elevated privileges.

Error: /var/www/html/var/logs does not exist or is not a directory.

----- Startup Checks Error Found -----

Please ensure the volume(s) is mounted correctly and is accessible.

If you are running this container as a non-root user, you may need to run the container with elevated privileges.

Error: /var/www/html/var/logs does not exist or is not a directory.

----- Startup Checks Error Found -----

Please ensure the volume(s) is mounted correctly and is accessible.

If you are running this container as a non-root user, you may need to run the container with elevated privileges.

Error: /var/www/html/var/logs does not exist or is not a directory.

----- Startup Checks Error Found -----

Please ensure the volume(s) is mounted correctly and is accessible.

If you are running this container as a non-root user, you may need to run the container with elevated privileges.

Error: /var/www/html/var/logs does not exist or is not a directory.

----- Startup Checks Error Found -----

Please ensure the volume(s) is mounted correctly and is accessible.

If you are running this container as a non-root user, you may need to run the container with elevated privileges.

Error: /var/www/html/var/logs does not exist or is not a directory.

----- Startup Checks Error Found -----

Please ensure the volume(s) is mounted correctly and is accessible.

If you are running this container as a non-root user, you may need to run the container with elevated privileges.

Error: /var/www/html/var/logs does not exist or is not a directory.

----- Startup Checks Error Found -----

Please ensure the volume(s) is mounted correctly and is accessible.

If you are running this container as a non-root user, you may need to run the container with elevated privileges.

If you are running this container as a non-root user, you may need to run the container with elevated privileges.

Error: /var/www/html/var/logs does not exist or is not a directory.

----- Startup Checks Error Found -----

Please ensure the volume(s) is mounted correctly and is accessible.

$10 Bounty

1 Replies

gabztoo
FREE

14 days ago

The image is building correctly. The issue is happening at startup, before Mautic actually runs.

What’s going on

Mautic expects this directory to exist and be writable inside the container:

/var/www/html/var/logs

On Railway, this error usually appears when:

  • A volume is mounted in /var/www/html/var (or /var/www/html/var/logs) and it hides the folders that already exist in the image, or

  • The folder exists but is owned by root, while the container runs as www-data, so Mautic can’t access it.

That’s why the startup check keeps failing with the same message.

How to fix it

1) Check the volume mount

If you’re using a volume, I recommend mounting it at:

/var/www/html/var

Mounting at the var level tends to be more reliable than mounting only var/logs.

If you already mounted a volume to /var/www/html/var/logs, try removing it and re-adding it at /var/www/html/var.

2) Ensure the directory exists and has the right permissions

Since this project is based directly on mautic/mautic:latest, the safest fix is to slightly extend the Dockerfile so the folder is always created with the correct ownership.

Update your Dockerfile to:

FROM mautic/mautic:latest

USER root

RUN mkdir -p /var/www/html/var/logs \

&& chown -R www-data:www-data /var/www/html/var

USER www-data

This makes sure the directory exists and that Mautic can write to it, even when a Railway volume is mounted.

Required environment variables (minimum)

Assuming you’re using a Railway MySQL service, these should be set on the Mautic service:

  • PORT=80

  • MAUTIC_ADMIN_EMAIL

  • MAUTIC_ADMIN_PASSWORD

  • MAUTIC_DB_HOST=${{mysql.MYSQLHOST}}:${{mysql.MYSQLPORT}}

  • MAUTIC_DB_NAME=${{mysql.MYSQLDATABASE}}

  • MAUTIC_DB_USER=${{mysql.MYSQLUSER}}

  • MAUTIC_DB_PASSWORD=${{mysql.MYSQLPASSWORD}}

  • MAUTIC_URL=https://<your-railway-domain>

  • MAUTIC_TRUSTED_PROXIES=["0.0.0.0/0"]

One more note

Railway also has a ready-made Mautic template based on this repo. If you’re just testing or want the quickest path, starting from the template can save a bit of setup time. That said, your current approach is totally fine — it just needs the folder/permission fix above.

If you’d like, let me know:

  • Where your volume is currently mounted, and

  • Whether you’re deploying from the template or directly from GitHub


Loading...