Deployment guide

SCM-Manager

Overview

SCM-Manager is an open-source, self-hosted repository manager. It hosts your Git, Mercurial and Subversion repositories behind a single web interface and REST API, so teams have one place to create and browse repositories, review code, and manage users, groups and fine-grained permissions.

This image runs SCM-Manager as a Java application on an embedded Jetty server, behind nginx as a reverse proxy. The server listens on 127.0.0.1:8080 at the root context path and is reached through nginx on port 80 (and 443 once you add TLS). Because the application binds to the loopback interface only, nginx is the single network entry point.

On the first boot of every VM, a one-shot service generates a per-VM administrator password, seeds the administrator account with it, resolves the VM's address, and then opens the network port. The well-known upstream default login (scmadmin / scmadmin) is never reachable: the per-VM password replaces it, the default is verified to be rejected, and nginx stays closed until first boot has seeded the secret. The login is written to /root/scm-manager-credentials.txt with mode 0600.

What you get:

  • SCM-Manager 3.11 installed from the official upstream apt repository as the scm-server package, behind nginx on :80
  • Built-in support for Git, Mercurial and Subversion repositories (the core plugins ship bundled)
  • The application bound to loopback only, reverse-proxied by nginx, with forwarded-header handling for correct URLs
  • A per-VM administrator password generated at first boot, stored in a root-only file, with the upstream default disabled
  • scm-server.service and nginx.service as systemd units, enabled and active
  • OpenJDK 17 as the system-managed Java runtime, patched at build time, with unattended security upgrades enabled
  • 24/7 SecureAnyCloud support

Prerequisites

You need an active Azure subscription, an SSH key pair, and a VNet with a subnet in the target region.

Standard_B2s (2 vCPU / 4 GiB RAM) is a good starting size. Choose a larger size for bigger teams or heavier repository workloads.

Configure the network security group (NSG) to allow inbound 22/tcp from your management network for SSH admin access. Also allow 80/tcp (plus 443/tcp once you enable TLS) from the networks your users reach SCM-Manager on.

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for SCM-Manager by SecureAnyCloud, and select Create.

On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80).

Select Review + create, then Create.

Step 2 - Deploy from the Azure CLI

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:scm-manager-ubuntu-24-04:default:latest
az vm create \
  --resource-group <your-rg> \
  --name scm-manager \
  --image sac1647283583153:scm-manager-ubuntu-24-04:default:latest \
  --size Standard_B2s \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_ed25519.pub \
  --vnet-name <your-vnet> --subnet <your-subnet> \
  --public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name scm-manager --port 80 --priority 1010

First-boot initialisation takes under a minute after the VM reaches the Running state. The Java service warms up on first start.

Step 3 - Connect to your VM

Connect over SSH as azureuser.

ssh azureuser@<vm-public-ip>

Step 4 - Confirm the services are running

Check that both services are active and that the REST API answers.

systemctl is-active scm-server.service nginx.service curl -fsS -o /dev/null -w '%{http_code}\n' http://127.0.0.1/api/v2

Both units report active and the REST API index returns 200. This confirms that nginx and the SCM-Manager server are both serving. The server listens on 127.0.0.1:8080, and nginx is the only process bound to the public :80.

Step 5 - Retrieve the administrator login

Your VM creates a unique administrator account on first boot and writes the login to a root-only file. Read it with sudo:

sudo cat /root/scm-manager-credentials.txt

The plain-text file contains the SCM-Manager URL, the administrator username (scmadmin) and the per-VM password. The upstream default password is not used, and signing in with scmadmin / scmadmin is rejected.

Step 6 - Sign in for the first time

Browse to http://<vm-public-ip>/. SCM-Manager opens on its sign-in page. Enter the username scmadmin and the password from /root/scm-manager-credentials.txt, then select Login.

After you sign in, you land on the repositories overview. It lists every repository across your namespaces, with search and filtering, and offers a Create Repository action.

Step 7 - Create a repository

Select Create Repository and choose the type: Git, Mercurial or Subversion. Give the repository a namespace and a name, optionally initialise it, and create it. The repository opens on its own page with its sources, branches, commits and clone information.

You can also create a repository from the command line through the REST API. This example creates a Git repository and lists what exists:

sudo bash -c ' PASS=$(grep "^scm.admin.pass=" /root/scm-manager-credentials.txt | cut -d= -f2-) curl -s -u "scmadmin:$PASS" -X POST "http://127.0.0.1/api/v2/repositories?initialize=true" \
  -H "Content-Type: application/vnd.scmm-repository+json;v=2" \
  -d "{\"name\":\"hello-world\",\"namespace\":\"scmadmin\",\"type\":\"git\",\"description\":\"Sample repository\"}" \
  -w "HTTP %{http_code}\n" '

Step 8 - Clone and push code

Clone a repository over HTTP, commit, and push back. Replace the values in angle brackets with your own:

git clone http://scmadmin@<vm-public-ip>/repo/scmadmin/hello-world cd hello-world echo "# Hello World" > README.md
git add README.md && git commit -m "first commit"
git push origin main

Git prompts for the scmadmin password from /root/scm-manager-credentials.txt. To clone Mercurial and Subversion repositories, use hg clone and svn checkout against the same http://<vm-public-ip>/repo/<namespace>/<name> URL.

Step 9 - Confirm the runtime and use the API

Check the installed SCM-Manager package version and the SCM_HOME layout:

dpkg-query -W -f='${Package} ${Version}\n' scm-server

Every action in the web app is also available through the REST API at http://<vm-public-ip>/api/v2/. Authenticate with HTTP Basic auth (the scmadmin login) or with an API key you create under scmadmin -> Settings -> API Keys. The index at /api/v2 lists the available resources.

Enabling HTTPS

For production, serve SCM-Manager over HTTPS so that logins and Git operations cannot be intercepted. The image ships with nginx, which certbot can configure automatically.

The following commands assume a DNS record that points your fully qualified domain name at the VM's public IP address, and port 443 open in the NSG:

sudo apt-get update && sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d scm.your-domain.example \
  --non-interactive --agree-tos -m you@your-domain.example \
  --redirect

The server has forwardHeadersEnabled set and nginx passes the X-Forwarded-* headers. Once TLS is in front, SCM-Manager therefore builds correct links and clone URLs automatically.

Backup and maintenance

SCM-Manager keeps all of its state under the home directory /var/lib/scm. This includes repositories, users, groups, permissions and configuration. Back it up regularly:

cd /tmp
sudo systemctl stop scm-server.service
sudo tar czf /tmp/scm-backup-$(date +%F).tgz -C /var/lib/scm .
sudo systemctl start scm-server.service ls -lh /tmp/scm-backup-$(date +%F).tgz

Move the archive off the VM, for example to an Azure storage account. Alternatively, take an Azure disk snapshot of the OS disk while the service is stopped.

To upgrade SCM-Manager, run sudo apt-get update && sudo apt-get install --only-upgrade scm-server and restart the service. Keep the OS patched with sudo apt update && sudo apt upgrade. See https://scm-manager.org/docs/.

Scaling and operations

  • Put the web tier behind Azure Application Gateway or a load balancer if you need high availability
  • Move /var/lib/scm onto a dedicated Azure data disk and snapshot it independently for larger repository sets
  • Add plugins from the built-in plugin catalog (pull requests, code review, mirroring, authentication backends) under Administration -> Plugins

Each of these is documented in the official SCM-Manager documentation at https://scm-manager.org/docs/.

Support

SecureAnyCloud provides 24/7/365 expert technical support for this image. Guaranteed response within 24 hours, one hour average for critical issues. Contact sales@secureanycloud.com.

For general SCM-Manager questions, consult the documentation at https://scm-manager.org/docs/. SCM-Manager is licensed under the GNU Affero General Public License v3.0, and the unmodified upstream package is shipped on this image. SCM-Manager is a trademark of its respective owner. Its use here is nominative and does not imply affiliation or endorsement. All product and company names are trademarks or registered trademarks of their respective holders.

Deploy on Azure

Launch SCM-Manager on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure