Error: URL in config must be provided with protocol

I’m trying to spin up Ghost in a Docker container that is proxied through a Cloudflare tunnel (also via Docker) instead of something like Nginx, Caddy, etc.

To start, I created the ‘cloudflared’ tunnel container and configured the DNS record for my domain to point to the tunnel ID.

However, when I try to create the Ghost container via docker-compose using as the URL variable, I receive the following error:

Error: URL in config must be provided with protocol, eg. ""

My site should be configured for SSL given it’s connected to a Cloudflare tunnel, so I’m not sure why I might be running into this issue.

I’ve tried changing the URL variable to but receive the same error.

Any thoughts?

Maybe there’s an indenting problem in your docker-compose.yml file. Post your docker-compose.yml file, anonymizing the contents if needed.

I was able to solve my problem. I was using hyphens in the variables I was declaring in my .env file, which docker-compose apparently doesn’t allow.

Replacing them with underscores seems to have done the trick!

That’s not just Docker Compose, but environment variables in general.

Usually they contain only letters, numbers and the underscore, and have to start with a letter.

Ref: syntax - Allowed characters in Linux environment variable names - Stack Overflow