Skip to content

How to Self-Host Gitea and Access Your Git Server from Anywhere

Run your own private Git server with Gitea on Docker Compose. Expose the web interface and SSH cloning from anywhere using two Localtonet tunnels.

Summary in your language
In this article 10 sections
Gitea · Self-Hosted Git · Docker Compose · Localtonet

Run your own Git service locally, then publish its web and SSH endpoints safely

Gitea provides repository hosting, code review, issues, releases, and collaboration features on infrastructure you control. This guide deploys Gitea with Docker Compose and SQLite, keeps its host ports bound to loopback, and connects it to our platform. You will configure an HTTP tunnel for the web interface and HTTPS cloning, optionally add a TCP tunnel for Git over SSH, and test real repository operations. The guide also includes registration controls, offline backups, a complete same-version restore drill, and controlled upgrades.

🔒 Loopback-only host ports 🌐 HTTPS and SSH access 💾 Offline SQLite backup and recovery
Remote browser and Git client reaching a self-hosted Gitea server through separate HTTP and TCP tunnels.
Gitea remains on the Docker host while separate tunnels provide remote web and SSH access.

Understand the deployment architecture

This deployment has three layers. Gitea runs in a standard, rootful Docker container. Docker publishes its web and SSH ports on the host's loopback interface. The Localtonet client, running directly on that same host, connects these listeners to public relay endpoints through an outbound connection. With our platform, this workflow does not require inbound router port forwarding, a public IP address, or a VPN.

Browser traffic and Git over HTTPS share the HTTP tunnel. Git over SSH uses a separate TCP tunnel. If your team exclusively uses HTTPS cloning, the TCP tunnel is optional. Standard tunneling publishes particular services; it does not create a private VPN network.

TrafficPublic endpointLocal targetContainer port
Web interface and Git over HTTPSHTTP tunnel's HTTPS URL127.0.0.1:30003000
Git over SSHTCP tunnel's host and port127.0.0.1:222222
Local administrationNo public endpoint requiredhttp://127.0.0.1:30003000

The SSH port advertised to developers is not the container's listening port. For example, a public TCP endpoint can have an assigned port different from both host port 2222 and container port 22. Copy the actual assigned endpoint instead of assuming these numbers match.

Public access depends on the complete path

Creating a tunnel does not start it. Press Start, and keep the selected Localtonet device connected. The host, Gitea container, client connection, and required tunnel must all be available. HTTP and TCP tunnels have independent states.

Prepare the host and install prerequisites

The commands below target a fresh Ubuntu 24.04 LTS host using Docker Engine, the Compose plugin, and the standard rootful Gitea image. Run them in Bash with an administrative account. This is not a rootless-container tutorial, and the filesystem commands are not intended for Docker Desktop.

This narrower scope avoids assuming every Linux distribution has /etc/timezone. The Compose file does not mount either host timezone file. Hosts enforcing SELinux require a separately reviewed bind-mount labeling policy; do not disable SELinux or blindly reuse these Ubuntu instructions there.

💾Persistent capacityAllow space for repositories, attachments, LFS objects, packages, logs, and multiple backup generations. Monitor free space rather than assuming repository size is the only storage requirement.
👤Container identityThis example uses UID and GID 1000. The data directory must be writable by that identity without making it world-writable.
🔑Developer toolsInstall Git and an SSH client on the workstation. SSH users register public keys in Gitea and keep private keys on their own machines.

Install Docker Engine and Compose

Docker supports installation through its official Ubuntu apt repository or manually downloaded packages. The repository path below allows subsequent package updates through apt. It is intended for a fresh host without conflicting Docker packages. For an existing installation, review the conflict-removal guidance in the official Docker Engine Ubuntu instructions before changing packages.

sudo apt-get update
sudo apt-get install -y ca-certificates curl git openssh-client sqlite3
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
  -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" |
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io \
  docker-buildx-plugin docker-compose-plugin

sudo systemctl enable --now docker
sudo docker version
sudo docker compose version
sudo docker run --rm hello-world

We use sudo docker throughout, avoiding an implicit requirement to join the Docker group. Docker administration effectively grants root-level control of the host. Never make the Docker socket broadly writable to fix a permission error.

Check local ports

sudo ss -lntp | grep -E ':(3000|2222)[[:space:]]' || true

No matching listener normally means the ports are free. If another service owns one, identify it before stopping anything. A changed host port must also be changed in the corresponding Localtonet target.

Select and record a supported exact Gitea release

Release verification is required before deployment

The earlier article used 1.24.6. The evidence available for this revision does not establish that release as currently supported or security-current, and does not verify a replacement patch release or verification date. We therefore do not present that historical tag as a recommended deployment. Select a supported exact patch release from Gitea's official releases, review its security and upgrade notes, and record your actual verification date before proceeding.

The commands deliberately require your reviewed tag rather than silently pulling latest. Use the standard image, not a -rootless variant, because its paths and SSH setup differ. The Gitea Docker installation guide supplements the deployment below.

mkdir -p "$HOME/gitea"
cd "$HOME/gitea"
read -r -p "Reviewed exact Gitea patch tag: " GITEA_VERSION
test -n "$GITEA_VERSION" || exit 1
printf 'GITEA_VERSION=%s\n' "$GITEA_VERSION" > .env
printf 'Image tag: %s\nReview date: %s\n' \
  "$GITEA_VERSION" "$(date -u +%F)" > release-review.txt

The date records your review, not a claim that this article independently tested the chosen release. Retain the release notes, image identifier, and successful restore-test results with your operating records.

Install and connect the Localtonet client

Create an account, then use the Linux installation/download path provided through our official Localtonet documentation. Select the application matching the host's architecture, install or extract it according to that package's instructions, run it on the Gitea host, and authenticate the device using its device-specific token. Confirm the device appears connected in the dashboard before configuring tunnels.

The supplied product documentation does not establish a current Linux package URL, executable command, or service-installation command, so none is guessed here. Follow the package-specific installation instructions for those details. Keep tokens out of shell history, repositories, screenshots, and shared Compose files. Running the client inside another container would change what 127.0.0.1 means and is outside this setup.

Install Gitea with persistent SQLite storage

Docker Compose file and terminal starting a Gitea container with persistent storage.
Compose keeps the image, storage mount, and loopback port mappings together.

SQLite keeps this deployment self-contained. It can suit personal installations and modest workloads, but suitability depends on concurrency, repository activity, storage performance, and recovery requirements. An external database adds separate networking, credentials, readiness, and backup responsibilities.

Create the storage directory:

cd "$HOME/gitea"
mkdir -p data
sudo chown 1000:1000 data
sudo chmod 750 data

Create compose.yaml with the following contents:

services:
  server:
    image: docker.gitea.com/gitea:${GITEA_VERSION:?Set GITEA_VERSION in .env}
    environment:
      USER_UID: "1000"
      USER_GID: "1000"
    restart: unless-stopped
    volumes:
      - ./data:/data
    ports:
      - "127.0.0.1:3000:3000"
      - "127.0.0.1:2222:22"

The entire /data tree is persistent. Do not move the database, repositories, attachments, or other storage outside that tree if you intend to use the backup procedure below unchanged.

sudo docker compose config
sudo docker compose pull server
sudo docker compose up -d
sudo docker compose ps
sudo docker compose logs --tail=100 server
curl -I http://127.0.0.1:3000/

A container marked running is not necessarily ready. Wait for an HTTP response and investigate restart loops or permission errors before proceeding. Record the actual running image and application version:

sudo docker inspect "$(sudo docker compose ps -q server)" \
  --format '{{.Image}}' > image-id.txt
sudo docker compose exec -T --user git server gitea --version

Complete local setup before publishing anything

Open http://127.0.0.1:3000 on the host. On a headless server, use an existing authenticated administrative SSH connection from your workstation to forward the browser port:

ssh -L 3000:127.0.0.1:3000 ADMIN_USER@HOST

Then open that local URL on the workstation while the SSH session remains open. Replace the placeholders with your administrative account and reachable host. This temporary forwarding requires an existing authorized SSH path; it is not a reason to publish the unfinished installer.

  1. Select SQLite3. Set the database path to /data/gitea/gitea.db.
  2. Keep the repository root at /data/git/repositories and application storage within /data.
  3. Use temporary local values: domain localhost, root URL http://localhost:3000/, SSH domain localhost, and advertised SSH port 2222.
  4. Create the intended administrator with a unique username and strong password. Complete installation and confirm that account can sign in.

The generated configuration lives at data/gitea/conf/app.ini on the host. Edit existing sections rather than appending conflicting duplicates. Gitea's configuration reference describes the settings and their release-specific behavior.

Before editing configuration, make a protected copy:

sudo cp -a data/gitea/conf/app.ini \
  data/gitea/conf/app.ini.before-public-access
sudo chmod 600 data/gitea/conf/app.ini.before-public-access
sudoedit data/gitea/conf/app.ini

Harden registration and access before internet exposure

A tunnel changes reachability, not authorization. Anyone who can reach the public endpoint can attempt to interact with Gitea. Keep the unfinished installer private, patch the host and application, and use repository permissions rather than treating an obscure URL as an access control.

For an administrator-provisioned private instance, set the following values in their existing sections after installation:

[security]
INSTALL_LOCK = true

[service]
DISABLE_REGISTRATION = true
REQUIRE_SIGNIN_VIEW = true

INSTALL_LOCK prevents returning to the installer. DISABLE_REGISTRATION closes public account creation; administrators can provision intended users. REQUIRE_SIGNIN_VIEW requires sign-in to view pages under Gitea's normal access policy. It is not a substitute for making repositories private or reviewing organization permissions.

Restart and test the policy locally:

sudo docker compose restart server
sudo docker compose logs --tail=100 server

Use a signed-out browser window to confirm self-registration is unavailable and protected content requires authentication. Sign back in as the administrator to confirm you have not locked out normal administration. If the chosen release changes a setting, resolve that against its configuration reference before creating public tunnels.

  • Use private repositories for private code and grant the minimum team and organization permissions needed.
  • Enable account two-factor authentication where appropriate, protect recovery codes, and use narrowly scoped automation credentials.
  • Register only public SSH keys. Protect private keys with filesystem permissions and passphrases where practical.
  • Review webhooks, migration features, mail delivery, and other outbound integrations before enabling them.
  • Keep backup archives and app.ini confidential. Configuration contains security-sensitive material.
  • Retain loopback host bindings and follow your organization's network and exposure policies.

HTTPS protects the public web connection, while this configuration forwards to a local HTTP listener. Do not describe that as Gitea serving HTTPS itself. SSH retains its own host-key and public-key authentication across the TCP tunnel.

Publish the web interface and optional SSH service

Configure the HTTP tunnel

HTTP tunnel carrying remote browser traffic to the private Gitea web interface.
The same HTTP tunnel serves the browser interface and Git over HTTPS.

With the client installed on the host and Gitea working locally, follow this configuration flow. Our HTTP tunnel documentation provides the accompanying product guidance.

1

Confirm the device is connected

Select the device token associated with the Gitea host, not another machine whose loopback address points somewhere else.

2

Open the HTTP tunnel configuration

Choose Random Sub Domain, Custom Sub Domain, or Custom Domain as the Process Type. Availability depends on the current account and configuration. Check current documentation before configuring custom-domain DNS.

3

Select the device and relay

Choose the connected AuthToken and an available relay server from the dashboard. Do not hardcode an old server code.

4

Enter the local target

Use local IP 127.0.0.1 and port 3000.

5

Create and start the tunnel

Press Start and copy the exact public HTTPS URL from the running tunnel.

From another device, request the public URL. Replace the placeholder rather than typing it literally:

curl -I https://YOUR_HTTP_HOST/

A gateway error points first to the client-to-local-service path. A redirect to localhost points instead to Gitea's canonical URL, which you will update below.

Configure the TCP tunnel for SSH

Git SSH traffic reaching Gitea through a separate public TCP tunnel.
Git over SSH uses a separate TCP endpoint and Gitea's own SSH authentication.

Skip this tunnel if you only need HTTPS cloning. The TCP tunnel guidance is available through our tunnel documentation.

1

Open the TCP tunnel configuration

Create a TCP tunnel for the Gitea SSH service, not another HTTP tunnel.

2

Select the host's device token

Use the connected Gitea host from the HTTP configuration.

3

Choose an available relay

Select a current relay server from the dashboard.

4

Enter the SSH target

Set local IP 127.0.0.1 and local port 2222.

5

Start and record the endpoint

Create the tunnel, press Start, and copy its public host and port as YOUR_TCP_HOST and YOUR_TCP_PORT.

Set Gitea's external addresses

Edit the existing [server] section in data/gitea/conf/app.ini:

[server]
DOMAIN = YOUR_HTTP_HOST
ROOT_URL = https://YOUR_HTTP_HOST/
SSH_DOMAIN = YOUR_TCP_HOST
SSH_PORT = YOUR_TCP_PORT
Preserve the existing listener settings

Preserve other generated [server] values and do not add duplicate sections. ROOT_URL is the external HTTPS URL, including its trailing slash. SSH_PORT advertises the public TCP port; it does not change the container's port 22 listener. If you are not exposing SSH, do not insert fictional TCP endpoints.

sudo docker compose restart server
sudo docker compose logs --tail=100 server

Refresh Gitea through its public URL and inspect repository clone options. They should advertise the actual public endpoints rather than localhost. Endpoint persistence and available domain options depend on your current configuration and plan; do not assume an assigned address can never change.

Verify authentication, clone, push, and pull

Remote workflow for opening Gitea, cloning over SSH, committing, and pushing changes.
Real repository operations test more than a successful home page response.

Sign in through the public HTTPS URL and create an empty private repository named tunnel-test. Do not initialize it with files for the commands below. In your user's SSH key settings, register a workstation public key. If you need a new key, use ssh-keygen -t ed25519, choose a new filename rather than overwriting an existing identity, and protect it appropriately.

Verify the server's SSH identity

On the trusted host, inspect the persistent host public key:

sudo docker compose exec server \
  ssh-keygen -lf /data/ssh/ssh_host_ed25519_key.pub

If your selected image uses a different location or host-key type, inspect its active SSH configuration rather than assuming the fingerprint. From the developer workstation, connect through the tunnel:

ssh -T -p YOUR_TCP_PORT git@YOUR_TCP_HOST

Compare the displayed fingerprint with the trusted host value before accepting it. Successful authentication can report that shell access is unavailable; that is normal for a Git service. An unexplained host-key change is a reason to stop and investigate, not automatically delete a known_hosts entry.

Push a commit and retrieve it again

On the workstation, ensure Git has your intended author name and email configured. Substitute your actual Gitea username and endpoint:

mkdir tunnel-test
cd tunnel-test
git init
printf '# Tunnel test\n' > README.md
git add README.md
git commit -m "Verify remote Gitea access"
git branch -M main
git remote add origin ssh://git@YOUR_TCP_HOST:YOUR_TCP_PORT/YOUR_USERNAME/tunnel-test.git
git push -u origin main
git rev-parse HEAD

cd ..
git clone ssh://git@YOUR_TCP_HOST:YOUR_TCP_PORT/YOUR_USERNAME/tunnel-test.git tunnel-test-clone
cd tunnel-test-clone
cat README.md
git pull
git rev-parse HEAD

The two commit identifiers should match, and the web interface should show the same file and commit. Save that identifier with your recovery-test notes.

Test HTTPS cloning too

git clone https://YOUR_HTTP_HOST/YOUR_USERNAME/tunnel-test.git tunnel-test-https

Use Gitea-supported credentials or a suitably scoped access token when prompted. Two-factor authentication can require token-based Git authentication instead of an account password. Store credentials through a trusted credential manager, not in the remote URL or command history. Also test from a signed-out browser or unauthorized account to confirm private repository content is not exposed.

Back up, restore, and upgrade the SQLite deployment

Use an offline full-data backup for this layout

For this tutorial, recovery uses a cold archive of the entire persistent data tree and deployment files. Stopping Gitea removes application writes while the archive is created. This preserves SQLite, repositories, configuration secrets, application files, and persistent SSH keys together without depending on a particular gitea dump ZIP layout.

The previous one-off Compose dump command is not retained as a verified recipe. No supplied evidence confirms its entrypoint behavior, working-directory permissions, or dump semantics for a current exact image. Gitea's official backup and restore guidance covers its logical dump workflow. Do not apply logical-dump extraction instructions to the cold archive below, or vice versa.

Backup scope

This procedure requires SQLite at /data/gitea/gitea.db and all persistent application storage beneath /data. It does not cover external databases, object storage, external repository paths, or another process modifying the same files. Verify those assumptions before relying on it.

Before the maintenance window, record a known repository commit, an issue or other database-backed record, and the SSH host fingerprint. Stop both public tunnels, notify users, and let active operations finish. Then run:

cd "$HOME/gitea"
mkdir -p "$HOME/gitea-backups"
chmod 700 "$HOME/gitea-backups"
STAMP=$(date -u +%Y%m%dT%H%M%SZ)
BACKUP="$HOME/gitea-backups/gitea-$STAMP.tar.gz"

sudo docker compose stop server
sudo docker compose ps -a
sudo sqlite3 data/gitea/gitea.db 'PRAGMA integrity_check;'

Confirm the container is stopped and SQLite reports ok. Do not continue if the database is missing or corrupt. Create the archive outside the data tree:

sudo tar --numeric-owner -czpf "$BACKUP" \
  compose.yaml .env release-review.txt image-id.txt data
sudo chmod 600 "$BACKUP"
sudo tar -tzf "$BACKUP" | head -40
sudo sha256sum "$BACKUP" | sudo tee "$BACKUP.sha256" > /dev/null

sudo docker compose up -d
curl -I http://127.0.0.1:3000/

Inspect command exit statuses and logs. A failed archive is not a backup. After local checks pass, restart the tunnels and verify public access. Copy the archive and checksum to protected storage outside this host, retain multiple generations, and use encryption appropriate to your backup environment. Preserve access to the exact image as well, through your registry retention policy or a separately stored Docker image archive.

Restore into a clean, isolated project

This restore deliberately uses the same image, paths, UID, and GID as the backup. It is not an upgrade. Perform it on a separate isolated recovery host or during a maintenance window with the production container stopped. The example reuses ports 3000 and 2222, so it cannot run beside production on those ports.

Do not connect recovery tunnels yet. Block unintended outbound integrations using an approved isolated network environment before starting the restored application. A copied database may contain webhooks or mail configuration; simply leaving public tunnels stopped does not prevent outbound traffic.

Set BACKUP to the actual archive path. Verify its checksum and inspect its contents before extraction:

BACKUP=/absolute/path/to/gitea-TIMESTAMP.tar.gz
sudo sha256sum -c "$BACKUP.sha256"
sudo tar -tzf "$BACKUP" | less

Only restore a trusted archive. Expect compose.yaml, .env, the release records, and a data/ tree containing gitea/conf/app.ini, gitea/gitea.db, git/repositories/, and persistent SSH material. Reject unexpected absolute paths or parent-directory traversal entries. This is not the layout of a Gitea logical dump ZIP.

Create a new empty directory, extract the archive, and correct ownership. Do not merge it into a running or partly initialized instance:

RESTORE="$HOME/gitea-restore"
mkdir -m 700 "$RESTORE"
test -z "$(ls -A "$RESTORE")" || exit 1
sudo tar --numeric-owner -xzpf "$BACKUP" -C "$RESTORE"
cd "$RESTORE"

sudo chown -R 1000:1000 data
sudo chmod 600 data/gitea/conf/app.ini
sudo sqlite3 data/gitea/gitea.db 'PRAGMA integrity_check;'
sudo docker compose config

The integrity check must report ok. Confirm the restored .env selects the backup's exact Gitea version and compare the available image with image-id.txt. Load your retained image if needed. Do not allow a newer application version to migrate the database during a same-version recovery test.

For a local drill, edit the existing [server] settings in the restored app.ini to use DOMAIN = localhost, ROOT_URL = http://localhost:3000/, SSH_DOMAIN = localhost, and SSH_PORT = 2222. Preserve all secrets and other configuration. Confirm registration remains disabled and the install lock remains enabled.

Regenerate hooks and run acceptance tests

Because this cold restore preserves the same container paths and image, existing hooks should retain their original targets. When paths or installation details change, Gitea's restore guidance calls for regenerating repository hooks. After starting the isolated restored server, use the Gitea administration command rather than manually rewriting hook files:

sudo docker compose up -d
sudo docker compose logs --tail=200 server
sudo docker compose exec -T --user git server \
  gitea -c /data/gitea/conf/app.ini admin regenerate hooks
curl -I http://127.0.0.1:3000/

Check command success against your selected release. If it does not recognize the command, inspect that exact image's gitea admin --help and version-matched restore guidance; do not declare recovery complete without resolving hook generation and testing a push.

  1. Sign in with an existing account. An installation wizard appearing now means the expected configuration or database was not loaded.
  2. Open the known repository, issue, and any representative attachments or LFS content used by your instance.
  3. Compare the restored SSH host fingerprint with the recorded fingerprint. This full-data restore should preserve it.
  4. Clone through the local SSH listener and compare git rev-parse HEAD with the recorded commit.
  5. Push a new test commit, clone into another directory, and pull it back. Confirm the web interface shows the change.
  6. Use a signed-out browser to verify registration and private-content restrictions.
git clone ssh://git@127.0.0.1:2222/YOUR_USERNAME/tunnel-test.git restore-check
cd restore-check
git rev-parse HEAD
printf '\nRestore drill verified\n' >> README.md
git add README.md
git commit -m "Verify restored Gitea"
git push
git pull

Record the result and recovery time. For actual production recovery, restore the intended public URL settings, verify authentication locally, connect the approved Localtonet client, and start the required tunnels. Repeat the remote acceptance tests before reopening service to users. Do not let a drill instance send production notifications or accept real work.

Upgrade deliberately and retain a real rollback path

Review the Gitea upgrade instructions and intervening release notes. Create and test a pre-upgrade backup, record the old image, and update GITEA_VERSION in .env to the reviewed exact target patch. During the maintenance window:

sudo docker compose pull server
sudo docker compose up -d
sudo docker compose ps
sudo docker compose logs --tail=200 server
curl -I http://127.0.0.1:3000/

Repeat web, HTTPS clone, SSH, push, and pull tests. If migrations occurred, rolling back the image alone may be unsafe. Restore the pre-upgrade data together with the previous image. Never assume older code can read a database migrated by a newer version.

For routine operation, use sudo docker compose logs -f server, restart server, stop server, and up -d. Monitor disk space, backup completion, and authentication failures. After a reboot, verify Gitea locally, the Localtonet device connection, and both tunnel states rather than assuming every component restarted.

Troubleshoot from the local service outward

SymptomLikely areaAction
Port already allocatedHost listener conflictInspect sudo ss -lntp. Change the host mapping and tunnel target together if necessary.
Container restarts or permission deniedStorage ownershipInspect logs and UID/GID 1000 ownership. Do not apply world-writable permissions.
Database startup failsSQLite path or capacityCheck the configured path, writable storage, and free disk space. Restore missing data before starting a new installation.
Local HTTP refusedContainer or mappingCheck Compose status, logs, and 127.0.0.1:3000:3000 before debugging the public endpoint.
Public gateway errorTunnel-to-service pathConfirm local curl succeeds, the client runs on the correct host, and the target is port 3000.
Redirects to localhostCanonical URLCorrect ROOT_URL and DOMAIN, then restart Gitea.
Wrong SSH clone addressAdvertised SSH endpointCopy the active TCP host and port into SSH_DOMAIN and SSH_PORT.
SSH timeoutTCP reachabilityCheck tunnel state, device connection, and the host's port 2222 mapping.
SSH permission deniedUser authenticationUse SSH user git, register the correct public key, and inspect which key the workstation offers with ssh -v.
SSH host key changedServer identityInvestigate restore, reassignment, or rotation and verify the trusted fingerprint before changing known-host records.
Restore shows installerWrong data or configurationStop the container. Inspect extracted paths, database location, mount, ownership, and install lock.
Clone works but push fails after restoreAuthorization or hooksCheck repository permissions, ownership, hook regeneration output, and server logs.
Unavailable after rebootLifecycleCheck Docker, Gitea, Localtonet client connectivity, and each tunnel independently.

If an endpoint changes, update the corresponding Gitea settings and existing workstation remotes. Changing Gitea's displayed clone URL does not modify already-cloned repositories:

git remote -v
git remote set-url origin ssh://git@NEW_TCP_HOST:NEW_TCP_PORT/YOUR_USERNAME/YOUR_REPOSITORY.git

For HTTPS endpoint changes, also review webhook destinations, OAuth callback registrations, bookmarks, and automation configuration that explicitly stores the old URL.

Frequently asked questions

Do I need two tunnels if I only clone over HTTPS?

No. The HTTP tunnel supports both Gitea's web interface and Git over HTTPS. Add the TCP tunnel only when developers need Git over SSH. Use appropriate authentication for either transport.

Why bind Docker ports to 127.0.0.1?

Loopback binding avoids intentionally publishing the service on every host interface. Our client runs on the same host and can reach those listeners. Keep Docker patched and verify your actual host network exposure; loopback is not a replacement for application authentication.

How do I prevent strangers from creating accounts?

After creating the administrator, set DISABLE_REGISTRATION = true under [service], restart Gitea, and test signed out. For a private instance, also review REQUIRE_SIGNIN_VIEW, repository visibility, and organization permissions.

What proves a backup can actually be restored?

Restore it into an isolated same-version deployment, verify SQLite integrity, sign in with existing accounts, inspect known database records, compare repository commits and SSH fingerprints, and successfully push and retrieve a new commit. An archive existing on disk is not sufficient evidence.

Can I use PostgreSQL or migrate existing repositories?

Gitea supports external databases and repository migration workflows, but the SQLite backup procedure here does not cover external databases. Plain Git branches and tags can be pushed to a new Gitea remote. Imported issues and other metadata depend on the source platform, credentials, API, and Gitea version, so test a representative migration first.

Is the server publicly available whenever its container is running?

No. Public access also requires the selected Localtonet device to be connected and the relevant tunnel to be running. Check the HTTP and TCP paths independently after restarts or connectivity changes.

Connect your self-hosted Gitea server with Localtonet

Start with a locally verified, access-controlled Gitea installation. Use our HTTP tunnel for the web interface and HTTPS cloning, add TCP when you need SSH, and test your recovery procedure before your team depends on the service.

Get Started Free →

Corrections & updates

Substantive changes approved by the Localtonet editorial team are listed transparently below.

Reviewed and updated for accuracy and completeness.

Reviewed and updated for accuracy and completeness.

Localtonet is a secure multi-protocol tunneling and proxy platform designed to expose localhost, devices, private services, and AI agents to the public internet supporting HTTP/HTTPS tunnels, TCP/UDP forwarding, mobile proxy infrastructure, file server publishing, latency-optimized game connectivity, and developer-ready AI agent endpoint exposure from a single unified control plane.

Support