Tutorial: Run TriliumNext Server in Termux on Android #827
Nriver
started this conversation in
Show and tell
Replies: 2 comments
-
Just awesome. Thank you |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, it’s Nate again! :)
Exactly one year ago, I wrote a tutorial on how to run the original Trilium on Android. You can check it out here. Today, I'm back with a new guide for TriliumNext. Enjoy!
If you're looking to run TriliumNext on an arm64 pc, you can skip ahead and start directly from Step 5.
Tutorial: Run TriliumNext Server in Termux on Android
1. Install Termux
Download and install Termux from the official website.
2. Install PRoot Distro
Open Termux and install PRoot Distro, a tool for managing Linux distributions.
PRoot isn’t a virtual machine—learn more about it here.
Run the following command:
3. Install a Base System
I recommend using Manjaro. You can list available distributions with
proot-distro list
. To install Manjaro:4. Log in to Manjaro
Log into the newly installed Manjaro distribution:
5. Install Node.js
By default, Termux installs the latest version of Node.js, but it's generally better to use a specific, tested version for stability and compatibility. We’ll use
nvm
(Node Version Manager) to install a fixed version.First, install the necessary packages:
Then, install
nvm
:Install Node.js, here I use
v20.17.0
:6. Get TriliumNext Source Code
Unlike the original Trilium, TriliumNext cannot be installed via a release file and
npm install
. If you try this, you'll encounter an error, which is explained in the discussion here. Instead, you need to clone the source code directly:git clone https://github.com/TriliumNext/Notes trilium cd trilium
7. Install Global Packages
Install the necessary global packages:
8. Install Dependencies
This step can be tricky. You might encounter errors, so be prepared to retry the command or use a proxy. Run the following:
9. Start TriliumNext Server
Launch the TriliumNext server with the following command:
10. Access TriliumNext
http://127.0.0.1:8080
http://your_phone_ip:8080
11. Quick Startup with a Script
To start TriliumNext quickly, create a
.sh
script.Log into Manjaro:
Create the script:
Add the following content:
Save and exit the editor, then make the script executable:
chmod +x /root/run-trilium.sh exit
Now, to start Trilium quickly, run:
Additional Notes
Using a Proxy
If you face internet connectivity issues (e.g., during
curl
,npm install
, orgit clone
), you can use a proxy withproxychains
. Here’s how:Install
proxychains
:Modify the proxy settings:
vim /etc/proxychains.conf # Example proxy: http 127.0.0.1 1080
Use
proxychains
to run commands:Clearing Cache
If
npm install
keeps failing, try clearing the npm cache and node_modules:rm -rf node_modules rm -rf ~/.npm/_cacache
Why is it Slow?
If you find TriliumNext is running slowly, try these solutions:
Beta Was this translation helpful? Give feedback.
All reactions