Introduction Link to heading

Briar Mailbox offers a solution for Briar users to improve their reachability and reduce battery consumption. This guide will walk you through the steps to install and set up Briar Mailbox on your server.

Note: Always refer to briarproject.org for the most up-to-date and detailed information.

Prerequisites Link to heading

  • A server running GNU/Linux (either x86_64 or ARM64 architecture).
  • Basic command-line knowledge.

Install Link to heading

  1. Install dependencies:

    sudo apt update
    sudo apt install git default-jdk
    
  2. Clone the Briar Mailbox repository:

    git clone https://code.briarproject.org/briar/briar-mailbox.git
    cd briar-mailbox
    
  3. Prepare the /opt directory: Create a directory for Briar Mailbox:

    sudo mkdir -p /opt/briar-mailbox
    
  4. Compile the Briar Mailbox and move the JAR to /opt directory:

    For x86_64 GNU/Linux server:

    ./gradlew x86LinuxJar
    sudo mv mailbox-cli/build/libs/mailbox-cli-linux-x86_64.jar /opt/briar-mailbox/briar-mailbox.jar
    

    For ARM64 server:

    ./gradlew aarch64LinuxJar
    sudo mv mailbox-cli/build/libs/mailbox-cli-linux-aarch64.jar /opt/briar-mailbox/briar-mailbox.jar
    
  5. Set up a systemd service:

    sudo nano /etc/systemd/system/briar-mailbox.service
    

    Add the following content:

    [Unit]
    Description=Briar Mailbox Service
    After=network.target
    
    [Service]
    User=YOUR_USERNAME
    WorkingDirectory=/opt/briar-mailbox
    ExecStart=/usr/bin/java -jar /opt/briar-mailbox/briar-mailbox.jar
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
    

    Replace YOUR_USERNAME with your actual Linux username.

  6. Start and enable the service:

    sudo systemctl start briar-mailbox
    sudo systemctl enable briar-mailbox
    
  7. Check the connection information: View the logs to find the QR code or URL to connect to the mailbox:

    sudo journalctl -u briar-mailbox -f
    
  8. Connect to Briar Mailbox: Use the Briar app to connect to your server’s Briar Mailbox via Tor.

Update Link to heading

To update Briar Mailbox to the latest version, follow these steps:

  1. Navigate to the Briar Mailbox directory:

    cd path/to/briar-mailbox
    

    Replace path/to/briar-mailbox with the directory where you cloned the Briar Mailbox repository.

  2. Pull the latest version:

    git pull
    
  3. Recompile the Briar Mailbox:

    For x86_64 GNU/Linux server:

    ./gradlew x86LinuxJar
    sudo mv mailbox-cli/build/libs/mailbox-cli-linux-x86_64.jar /opt/briar-mailbox/briar-mailbox.jar
    

    For ARM64 server:

    ./gradlew aarch64LinuxJar
    sudo mv mailbox-cli/build/libs/mailbox-cli-linux-aarch64.jar /opt/briar-mailbox/briar-mailbox.jar
    
  4. Restart the service:

    sudo systemctl restart briar-mailbox
    
  5. Verification: Ensure the service is running without any issues:

    sudo systemctl status briar-mailbox
    

    You should see the service in an “active (running)” state.

Uninstall Link to heading

If for any reason you wish to uninstall or remove Briar Mailbox from your server, follow the steps below:

  1. Stop and disable the service:

    sudo systemctl stop briar-mailbox
    sudo systemctl disable briar-mailbox
    
  2. Remove the systemd service file:

    sudo rm /etc/systemd/system/briar-mailbox.service
    
  3. Delete the application files:

    sudo rm -r /opt/briar-mailbox
    

Resources Link to heading

For more in-depth details and resources related to Briar Mailbox, you can refer to the following links: