5.10. Serve

Mercurial comes with an in-built, light-weight web server capable of serving a single repository for single connection. Serve does not provide user authentication, but does provide a convenient, ad-hoc method of synchronizing a repository over a local network. For more complete information on publishing repositories, see the Mercurial wiki article on Publishing Repositories.

5.10.1. From TortoiseHg

Web server dialog

The serve tool is a wrapper for Mercurial’s built-in web server. Once launched, a computer can connect to the http port and browse your repositories, perform clone, pull, or even push operations if enabled. The web server can be launched from either the Workbench (Repository Menu) or the Context Menu.

Toolbar buttons:

start the web server
stop the web server
Configure repository web style, description, and access policies

When the settings dialog is launched via the Configure button, it is run in the context of the current repository. Please visit the Mercurial wiki for detailed descriptions of the various web configurations.

In TortoiseHg 2.0, the serve tool natively supports collections of local repositories. Just drag them onto the web serve dialog while it is not running, or add them by hand using the editing buttons. The repository collections can be saved and reloaded.

5.10.2. From command line

The server tool can be started from command line

thg serve [OPTION]...

start stand-alone webserver


        --webdir-conf  name of the webdir config file

use "thg -v help serve" to show global options