Issue with Self-Hosted Invoice Ninja on Ubuntu – White Screen After Account Creation

Hi everyone,

I’m trying to set up a self-hosted Invoice Ninja instance on Ubuntu using Docker. I cloned both dockerfiles/debian and invoiceninja the repository and structured my files as follows:

invoiceninja/nginx  
invoiceninja/php  
invoiceninja/scripts  
invoiceninja/supervisor  
invoiceninja/Dockerfile  
invoiceninja/docker-compose.yml  
invoiceninja/app  
invoiceninja/bootstrap  
invoiceninja/config  
invoiceninja/database  
// Other Invoice Ninja files and folders  

I made modifications to docker-compose.yml, Dockerfile, and nginx/laravel.conf as needed. The build completes successfully, but after creating an account, the application shows a white screen (as seen in this video).

here is what I modified

Dockerfile

# Copy local Invoice Ninja code
COPY . /var/www/html

# PHP modules (ensure these include all required extensions)
ARG php_require="bcmath gd mbstring pdo_mysql zip"
ARG php_suggest="exif imagick intl pcntl soap saxon-12.5.0"
ARG php_extra="opcache"

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    mariadb-client \
    gpg \
    supervisor \
    fonts-noto-cjk-extra \
    fonts-wqy-microhei \
    fonts-wqy-zenhei \
    xfonts-wqy \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Install PHP extensions (this includes zip, bcmath, gd)
COPY --from=ghcr.io/mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

RUN install-php-extensions \
    ${php_require} \
    ${php_suggest} \
    ${php_extra}

# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# Install dependencies
RUN composer install --no-dev --prefer-dist --optimize-autoloader

# Create symlink for frontend
RUN ln -s /var/www/html/resources/views/react/index.blade.php /var/www/html/public/index.html \
    && php artisan storage:link \
    && mv /var/www/html/public /tmp/public

USER www-data

docker-compose.yml file

services:
  app:
    build:
      context: .  # Use local files instead of pulling from a remote image
    restart: unless-stopped
    env_file:
      - ./.env
    volumes:
      - .:/var/www/html
      - app_cache:/var/www/html/bootstrap/cache
      - app_public:/var/www/html/public
      - app_storage:/var/www/html/storage

laravel.txt

location ~ \.php$ {
    fastcgi_pass invoiceninja-app-1:9000;
    fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
    include fastcgi_params;
}

.env file

DB_HOST="invoiceninja-mysql-1"
DB_DATABASE="ninja"
DB_USERNAME="ninja"
DB_PASSWORD="ninja"
DB_PORT="3306"
MYSQL_ROOT_PASSWORD="root"

Could someone please help me troubleshoot this issue? Any guidance would be greatly appreciated!

Thanks in advance!

Hi,

Are you using the latest available version of the app?

Are there any errors in the web server error logs?

Hi @hillel ,

Thank you for the quick response.

Are you using the latest available version of the app?

Yes, I am using the latest version 5.11.43.

Are there any errors in the web server error logs?

There are no errors in the error.log file.

$ docker exec -it invoiceninja-nginx-1 /bin/sh
/ # cat /var/log/nginx/error.log

If you need any further files to check or anything else for debugging, feel free to ask. Thank you!

The latest version is v5.11.61

Even with the latest version, it is behaving the same way.

I’m not sure, here’s what ChatGPT suggests:

If you’re getting a white screen (also known as a “WSOD” — White Screen of Death) after setting up Invoice Ninja with Docker, it usually means a PHP error is occurring silently. Laravel by default hides errors in production mode. Here’s how you can dig in and resolve it:


:white_check_mark: Step-by-step Debugging & Fix Suggestions

1. Turn on Laravel Debug Mode

In your .env file, make sure to set APP_DEBUG=true and APP_ENV=local:

APP_ENV=local
APP_DEBUG=true

Then rebuild and restart containers:

docker-compose down
docker-compose up --build -d

This should give you a stack trace instead of a white screen.


2. Check Laravel Logs

Log into your container:

docker exec -it invoiceninja-app-1 bash

Then check the log file:

tail -n 100 storage/logs/laravel.log

Look for any error stack traces — this is your most direct clue.


3. Permissions Fix

Laravel needs writable permissions on these directories:

  • storage/
  • bootstrap/cache/

Run inside the container or from the host:

sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R 775 storage bootstrap/cache

Also make sure your volumes in docker-compose.yml aren’t overwriting these permissions. Try commenting out the volumes one by one to test.


4. Frontend Build Missing?

Invoice Ninja uses a React frontend — if you see a white screen after login, it could mean:

  • The frontend didn’t build properly
  • The symlink to index.html isn’t being served correctly

Check that this file exists inside the container:

ls -l /var/www/html/public/index.html

If it’s broken or missing, re-run:

ln -s /var/www/html/resources/views/react/index.blade.php /var/www/html/public/index.html

Also verify your nginx config points to /var/www/html/public.


5. Check NGINX Error Logs

Check if NGINX is throwing any errors:

docker logs invoiceninja-web-1  # Or whatever your nginx service is called

Look for Permission denied, File not found, or Bad gateway.


6. Run Laravel Setup Commands

Sometimes these are skipped during Docker build. Try running:

php artisan migrate --force
php artisan optimize
php artisan config:clear
php artisan cache:clear

7. Double-check Database Connection

Try connecting manually:

php artisan tinker
DB::connection()->getPdo();

If this fails, double-check DB_HOST and make sure the MySQL container is up and accepting connections. You can also ping or telnet to the database container from within app.


Bonus Tip: Simplify Docker Volumes During Testing

Mounting your full project (.:/var/www/html) can overwrite files and permissions inside the container. For debugging, try replacing it with only the folders you need as volumes.


Recap Checklist

  • :white_check_mark: APP_DEBUG=true and check Laravel logs
  • :white_check_mark: Verify index.html symlink and frontend build
  • :white_check_mark: Check NGINX and PHP-FPM logs
  • :white_check_mark: Ensure permissions on storage/ and bootstrap/cache
  • :white_check_mark: Run artisan setup commands
  • :white_check_mark: Check DB connection

If you can share the contents of your Laravel logs (storage/logs/laravel.log) after turning on debug mode, I can help pinpoint the issue further.

Want to try those steps and paste the output here?

Hi @hillel

Apologies for the delayed response—I was on an extended vacation and couldn’t provide an update earlier.

Thank you for your detailed answer. I have tried all the suggested solutions, but unfortunately, I’m still unable to resolve the issue.

I’m attaching my Docker setup for Invoice Ninja. Could you take some time to run it and identify the problem? Your insights on how to fix this would be greatly appreciated.

Here’s the link to the compressed file: Google Drive Link. Simply extract it and run the following command:
docker-compose up --build -d

Thank you again for your help!

Best regards,
Belt

If you’re using a custom docker file I suggest changing to the standard one.

I’ve cloned the standard Invoice Ninja repository but modified the volumes to use local files since I run it as a fully standalone instance. The local files are also cloned from the standard setup. However, I’m facing issues while trying to build it.

Sorry, I don’t have much experience with Docker

That’s okay! Hopefully, someone familiar with Docker can assist me with this.