Forrest logo
back to the cloudflared tool


cloudflared: Save logs to a file.
$ cloudflared tunnel --hostname ${hostname} http://localhost:${port_number} --loglevel ${select} --logfile ${filename}
try on your machine

This command uses the "cloudflared" tool to create a tunnel, which allows secure access to a local web server.

Here is a breakdown of the command structure and the meaning of each part:

  • cloudflared is the name of the command-line tool used to set up tunnels.
  • tunnel is the specific command that creates a tunnel.
  • --hostname ${hostname} specifies the hostname for the tunnel. You need to replace ${hostname} with the desired hostname.
  • http://localhost:${port_number} is the address of the local web server that you want to expose through the tunnel. You will need to replace ${port_number} with the appropriate port number.
  • --loglevel ${select} sets the log level for the tunnel, allowing you to control the verbosity of the log messages. You need to replace ${select} with the desired log level (e.g., "debug", "info", "warn").
  • --logfile ${filename} specifies the log file path where the tunnel's log messages will be written. You will need to replace ${filename} with the desired filename or path.

When you run this command, it will initialize the Cloudflare tunnel using the specified parameters, allowing secure access to the local web server through a unique URL provided by Cloudflare.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the cloudflared tool