A Matrix bridge for LINE Messenger using mautrix-go.
Based on the mautrix-twilio bridge
Warning
When updating from a version released before February 14, 2026,
please make sure to reset your configuration and log in again.
This is due to a change in the login flow that requires users to log
in again to fetch the necessary keys for E2EE decryption.
Note
Messages sent to the LINE Bot using Beeper Desktop may appear as
indefinitely sending.
Use Beeper Mobile to send commands to the LINE Bot account after
creating the chat with Beeper Desktop.
- Messages (Text, Images, Videos, voice notes and any other kind of files)
- Read receipts
- Reaction support (Receive ONLY)
- Replies
- Prefetch missed chats upon starting the bridge
- Group chats
- Sticker retrieval support
- Link previews
- Message unsending/deletion
- Leaving chats
-
Prerequisites:
- For Windows users: Install MSYS2 and gcc for mingw-w64
# Step 1: Make sure you have MSYS2 installed and gcc for mingw-w64 winget install MSYS2.MSYS2 # Open MSYS2 MinGW 64-bit terminal and install necessary packages pacman -Syu mingw-w64-x86_64-gcc cmake
Ensure you have Docker and Docker Compose installed on your system. If you want to build and run without Docker, ensure you have Go installed along with necessary build tools, such as the olm library.
- For Beeper users: Compile bbctl from source if you don't have it already:
git clone https://github.com/beeper/bridge-manager.git cd bridge-manager # For windows users only: # In cmd/bbctl/run.go, remove the following lines because MSYS2 is # still seen as Linux, but Windows doesn't support Setpgid: # if runtime.GOOS == "linux" { # cmd.SysProcAttr = &syscall.SysProcAttr{ # // Don't pass through signals to the bridge. # // We'll send a sigterm when we want to stop it. # // Causes weird issues on macOS, so limited to Linux. # Setpgid: true, # } # } ./build.sh
-
Clone the repository:
git clone https://github.com/highesttt/matrix-line-messenger.git cd matrix-line-messenger -
Create a
datadirectory for configuration and data storage:mkdir data
-
Create a configuration file:
- For Beeper users (using bbctl):
bbctl c --type bridgev2 sh-line > data/config.yaml- For self-hosted Matrix servers (Synapse, Conduit, etc.):
First, build the bridge binary (see step 5), then generate the example config and registration:
# Generate example config ./matrix-line -e -c data/config.yaml # Edit data/config.yaml and set: # homeserver.address: http://localhost:8008 (your Matrix server URL) # homeserver.domain: your.domain.com (your Matrix server domain) # appservice.database.uri: sqlite:///data/matrix-line.db (or a postgres URI) # Generate appservice registration ./matrix-line -g -c data/config.yaml -r data/registration.yaml
Then register the appservice with your homeserver by adding the registration file path to your homeserver config. For Synapse, add it to
app_service_config_filesinhomeserver.yaml, then restart the homeserver. -
Build and run the bridge using Docker (use -d for detached mode):
- Using Docker Compose:
docker compose up --build -d
To run the bridge without rebuilding, use:
docker compose up -d
- Building and running without Docker on Windows (MSYS2 and
x86_64-w64-mingw32-gccrequired)
# Clone and build olm if not already done git clone https://gitlab.matrix.org/matrix-org/olm.git cd olm cmake -Bbuild -G "Unix Makefiles" \ -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \ -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \ -DCMAKE_INSTALL_PREFIX=/mingw64 cmake --build build cmake --install build cd .. # Move the .dll and .dll.a files in the matrix-line root directory # Build the bridge. # Make sure the olm .dll file(s) are in the root of the project. ./build-windows.sh cd data ../matrix-line.exe
- Other systems:
./build.sh cd data ../matrix-line
- Open the Matrix client of your choice and start a chat with
@sh-linebot:your.matrix.homeserver.domain. For local Beeper bridges, use@sh-linebot:beeper.local. - Send the command
loginand follow the instructions to log in to your LINE account.
or
- Open Beeper Desktop Settings
- Navigate to
Bridges - Click the three dots next to your LINE Bridge and select
Experimental: Add an account - Follow the instructions to log in to your LINE account.
There are two common reasons login can fail:
This bridge uses the email from your account information. If your account is older, you signed in using a phone number, or you signed in with Google, you may not have an email set for your LINE account.
How to set an email for your LINE account:
- Open the LINE app on your mobile device.
- Go to
Settings>Account. - Tap on
Email addressand set your email address.
This bridge requires LINE's end-to-end encryption feature,
Letter Sealing, to be enabled. If it is disabled, the login will fail
with Error when logging in: Internal error.
How to enable Letter Sealing:
- Open the LINE app on your mobile device.
- Go to
Settings>Privacy. - Turn
Letter Sealingon (note: it can't be turned off once you do so) - Try logging in to the bridge again.
Note
- The
Letter Sealingsetting is only configurable from the LINE mobile app. - Once the setting's turned on it can't be turned off.
Letter Sealingwas introduced as an optional feature in August 2015.- It was enabled by default in major LINE clients in 2016.
- Since 2021, it has been enabled by default in all regions.
- For more information, see issue #42.