Skip to main content

Overview

Markdown-OS runs a local web server to provide the editor interface. You can customize the host interface and port number using command-line options.

Basic Usage

1

Default Configuration

By default, Markdown-OS binds to 127.0.0.1 (localhost) on port 8000:
2

Custom Port

Specify a different port with the --port option:
3

Custom Host

Change the host interface with the --host option:

Host Options

Localhost (Default)

Binds to the loopback interface, making the server accessible only from your local machine. This is the recommended and secure default for local development.

Network Binding

Binds to all network interfaces, making the server accessible from other devices on your network.
Binding to 0.0.0.0 or any non-loopback address exposes your files to the network without authentication. Only use this in trusted networks or when you specifically need remote access (e.g., cloud VMs, development servers).
When you use a non-loopback address, Markdown-OS displays a security warning:

Port Configuration

Auto-Increment Behavior

The --port option specifies the preferred starting port. If that port is already in use, Markdown-OS automatically increments to find the next available port.
Port Selection Logic:
  1. Tests if port 8000 is available
  2. If occupied, tries 8001, 8002, 8003…
  3. Continues up to port 65535
  4. Displays the actual port in the console output
Always check the console output to see which port was actually selected:

Valid Port Range

Ports must be between 1 and 65535. Using an invalid port number will result in an error:

Port Availability Check

Markdown-OS uses socket binding tests to determine port availability. The check:
  • Attempts to bind a TCP socket with SO_REUSEADDR option
  • Tests the specific host/port combination
  • Returns the first available port in the range

Cloud and Remote Development

Cloud VMs (Cursor Cloud, GitHub Codespaces, etc.)

When running Markdown-OS in a cloud VM or remote development environment, you need to bind to 0.0.0.0 to allow browser access:
The CLI attempts to auto-open a browser. In cloud VMs, you may see harmless dbus errors in the logs. The server will still work correctly - just manually navigate to the URL shown in the console output.

Port Forwarding

If your cloud environment requires specific port forwarding rules, use the --port option to specify the forwarded port:

Common Patterns

Use different ports for each instance:
If you don’t specify different ports, auto-increment will handle it automatically, but explicit ports make it easier to remember which project is on which port.
To test that your server is accessible:

See Also