(Tor) Set up an obfs4 bridge
最后更新时间:
Bridge set up guide
This guide will help you set up an obfs4 bridge to help censored users connect to the Tor network. The requirements are:
24/7 Internet connectivity
The ability to expose TCP ports to the Internet (make sure that NAT doesn't get in the way)
Note: If you’re running a platform that is not listed on this page, you can compile obfs4 from source.
- Debian / Ubuntu: How to deploy an obfs4 bridge on Debian / Ubuntu
- Windows: How to deploy an obfs4 bridge on Windows
- Fedora: How to deploy an obfs4 bridge on Fedora
- CentOS / RHEL / OpenSUSE: How to deploy an obfs4 bridge on CentOS / RHEL / OpenSUSE
- DragonflyBSD: How to deploy an obfs4 bridge on DragonflyBSD
- Docker: How to deploy an obfs4 bridge using a docker container
- Post-install: How to find your bridge in Relay Search and connect manually
- NetBSD: How to deploy an obfs4 bridge on NetBSD
Set up bridge by using Docker
1. Deploy a container
We provide a docker-compose file that helps you deploy the container. First, download docker-compose.yml:
1 |
|
and then write your bridge configuration to a new file, .env
, which is in the same directory as docker-compose.yml
. Here’s a template:
1 |
|
Replace X
with your desired OR port, Y
with your obfs4 port (make sure that both ports are forwarded in your firewall), and Z
with your email address, which allows us to get in touch with you if there are problems with your bridge. With your bridge configuration in place, you can now deploy the container by running:
1 |
|
This command will automatically load your docker-compose.yml file while considering the environment variables in .env
.
You should now see output similar to the following:
1 |
|
That’s it! Your container is now bootstrapping your new obfs4 bridge.
2. Upgrade your container
Upgrading to the latest version of our image is as simple as running:
1 |
|
Note that your bridge’s data directory (which includes its key material) is stored in a docker volume, so you won’t lose your bridge’s identity when upgrading to the latest docker image. If you are running multiple bridges on your computer, you need to repeat this step for each bridge. We will announce new image versions on the tor-dev mailing list.
3. Monitor your logs
You can inspect your bridge’s logs by running:
1 |
|
To use your new bridge in Tor Browser, you need its “bridge line”. Here’s how you can get your bridge line:
1 |
|
This will return a string similar to the following:
1 |
|
Make sure to check out the post-install notes. If you are having troubles setting up your bridge, have a look at our help section.
post-install notes
1 |
|
our help section
If you run into problems while setting up your relay, you can ask your questions on the public tor-relays mailing list. The list is a great resource for asking (and answering) questions, and for getting to know other relay operators. Make sure to check out the archives!
You can also get help by joining the IRC channel #tor-relays in the network irc.oftc.net.