Install Joplin Server without docker

Hello,

I wish to run Joplin server on a Raspberry PI4 to sync many phone/tablet/pc app without docker, but no luck.
Is there any updated tutorial ?
or a package source that can be used also for update ?
thanks

Try this: Joplin Server 2.9 LXC Build | syn-flood

thanks a lot, but still no luck.
on point 6 I got:

joplin@localhost:~$ cd /opt/joplin/
joplin@localhost:/opt/joplin$ BUILD_SEQUENCIAL=1 yarn install --inline-builds
Usage: yarn [options]

yarn: error: no such option: --inline-builds
joplin@localhost:/opt/joplin$

and without option:
joplin@localhosy:/opt/joplin$ BUILD_SEQUENCIAL=1 yarn install
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'install'
joplin@localhost:/opt/joplin$

the first steps until copying are easy and always OK.
no luck in building phase.

Hello,
I did some progress, now able to run yarn install command,
it completes 5/5 but error with gulp build:

[5/5] Building fresh packages...
success Saved lockfile.
$ gulp build
[18:49:39] No gulpfile found
error Command failed with exit code 1.

can anyone help, pls ?

PS if I try to run it I get following error:
[PM2] Spawning PM2 daemon with pm2_home=/home/joplin/.pm2
[PM2] PM2 Successfully daemonized
[PM2][WARN] Applications joplin-server not running, starting...
[PM2][ERROR] Error: Script not found: /opt/joplin/packages/server/dist/app.js

I also tried to run gulp build manually inside:
/opt/joplin/packages/server$ gulp build
[19:21:51] Using gulpfile /opt/joplin/packages/server/gulpfile.js
[19:21:51] Starting 'build'...
[19:21:51] Starting 'compilePackageInfo'...
Warning: Could not get git info (it will not be displayed in About dialog box)
Generated /opt/joplin/packages/server/dist/packageInfo.js
[19:21:51] Finished 'compilePackageInfo' after 33 ms
[19:21:51] Finished 'build' after 43 ms

but still no app.js

You also have to copy the gulpfile.js from the joplin root.

cp joplin/gulpfile.js /opt/joplin/

thanks,
added it, now one step further, but still no luck, new error:

$ gulp build
[23:59:55] Using gulpfile /opt/joplin/gulpfile.js
[23:59:55] Starting 'build'...
> yarn [ 'run', 'buildSequential' ]
yarn run v1.22.19
$ yarn workspaces foreach --verbose --interlaced --topological run build && yarn run tsc
error Invalid subcommand. Try "info, run"
info Visit yarn workspaces | Yarn for documentation about this command.
error Command failed with exit code 1.
info Visit yarn run | Yarn for documentation about this command.
[23:59:58] 'build' errored after 2.49 s
[23:59:58] Error: Command failed with exit code 1: yarn run buildSequential
error Invalid subcommand. Try "info, run"
error Command failed with exit code 1.
yarn run v1.22.19
$ yarn workspaces foreach --verbose --interlaced --topological run build && yarn run tsc
info Visit yarn workspaces | Yarn for documentation about this command.
info Visit yarn run | Yarn for documentation about this command.

  • at makeError (/opt/joplin/packages/tools/node_modules/execa/lib/error.js:59:11)*
  • at handlePromise (/opt/joplin/packages/tools/node_modules/execa/index.js:114:26)*
  • at process.processTicksAndRejections (node:internal/process/task_queues:95:5)*
  • at async fn (/opt/joplin/gulpfile.js:33:5)*
    error Command failed with exit code 1.
    info Visit yarn install | Yarn for documentation about this command.

any clue ?
thanks

Instead of copying files/directories, why don't you try to run the commands in the joplin root directory.

e.g. there's also a .yarn directory. You might need that too.

Then check which files were accessed and then you can go the other route and copy the necessary files over to a new directory.

thanks,
I'm not a docker/container expert and as you and many other at the beginning of the project I just need it to make it run on RPi4 with very few mem and storage without docker, I already needed to install PostgreSQL (hoping that in future MySQL would be possible), so I'm following tutorials made by others before me.

Thanks

you mean like this: ?
mkdir -p /opt/joplin/
useradd --create-home --shell /bin/bash joplin
chown -R joplin:joplin /opt/joplin
su -l joplin
git clone GitHub - laurent22/joplin: Joplin - an open source note taking and to-do application with synchronisation capabilities for Windows, macOS, Linux, Android and iOS.
cp -r joplin/ /opt/joplin/
cd /opt/joplin/
BUILD_SEQUENCIAL=1 yarn install --inline-builds

Nope. All the scripts that you a referring to take the joplin repo and copy bits and pieces to a different directory.

But apparently there are things missing. So just clone the repo and build the server in there: BUILD_SEQUENCIAL=1 yarn install --inline-builds

If that works you can check which files were touched during the build process thus know which files are needed when you do the copy-to-a-different-dir approach.

P.S.: when you look at the Dockerfile.server, you will see which files/directories are actually necessary:

COPY .yarn/plugins ./.yarn/plugins
COPY .yarn/releases ./.yarn/releases
COPY package.json .
COPY .yarnrc.yml .
COPY yarn.lock .
COPY gulpfile.js .
COPY tsconfig.json .
COPY packages/turndown ./packages/turndown
COPY packages/turndown-plugin-gfm ./packages/turndown-plugin-gfm
COPY packages/fork-htmlparser2 ./packages/fork-htmlparser2
COPY packages/server/package*.json ./packages/server/
COPY packages/fork-sax ./packages/fork-sax
COPY packages/fork-uslug ./packages/fork-uslug
COPY packages/htmlpack ./packages/htmlpack
COPY packages/renderer ./packages/renderer
COPY packages/tools ./packages/tools
COPY packages/lib ./packages/lib
COPY packages/server ./packages/server

Hello again,

thanks for the suggestion, but no luck.

copied all the files/directories:

mkdir -p /opt/joplin/packages/{fork-sax,lib,server}
mkdir -p /opt/joplin/.yarn

chown -R joplin:joplin /opt/joplin

cp -r /home/joplin/joplin/.yarn/plugins /opt/joplin/.yarn/plugins
cp -r /home/joplin/joplin/.yarn/releases /opt/joplin/.yarn/releases
cp -r /home/joplin/joplin/package.json .
cp -r /home/joplin/joplin/.yarnrc.yml .
cp -r /home/joplin/joplin/yarn.lock .
cp -r /home/joplin/joplin/gulpfile.js .
cp -r /home/joplin/joplin/tsconfig.json .
cp -r /home/joplin/joplin/packages/turndown /opt/joplin/packages/turndown
cp -r /home/joplin/joplin/packages/turndown-plugin-gfm /opt/joplin/packages/turndown-plugin-gfm
cp -r /home/joplin/joplin/packages/fork-htmlparser2 /opt/joplin/packages/fork-htmlparser2
cp -r /home/joplin/joplin/packages/server/package.json /opt/joplin/packages/server/*
cp -r /home/joplin/joplin/packages/fork-sax /opt/joplin/packages/fork-sax
cp -r /home/joplin/joplin/packages/fork-uslug /opt/joplin/packages/fork-uslug
cp -r /home/joplin/joplin/packages/htmlpack /opt/joplin/packages/htmlpack
cp -r /home/joplin/joplin/packages/renderer /opt/joplin/packages/renderer
cp -r /home/joplin/joplin/packages/tools /opt/joplin/packages/tools
cp -r /home/joplin/joplin/packages/lib /opt/joplin/packages/lib
cp -r /home/joplin/joplin/packages/server /opt/joplin/packages/server

and run
BUILD_SEQUENCIAL=1 yarn install --inline-builds

new error:
➤ YN0000: ┌ Resolution step
➤ YN0001: │ Error: @joplin/lib@npm:~2.10: No candidates found
at ge (/opt/joplin/.yarn/releases/yarn-3.3.1.cjs:439:7786)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
➤ YN0000: └ Completed in 4s 720ms
➤ YN0000: Failed with errors in 4s 746ms

any clue ?

P.S. my environment:
root@localhost:/# pm2 status
┌─────┬───────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
└─────┴───────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
root@localhost:/# npm --version
8.19.2
root@localhost:/# yarn --version
1.22.19
root@localhost:/# node --version
v18.12.1
root@localhost:/# gulp --version
CLI version: 2.3.0
Local version: Unknown
root@localhost:/#

So what did you change that it worked this time? The copy commands seems to be the same, although it looks like the .yarn files are missing. You only created the directory, but didn't copy the contents.

You should summarize for others what exactly you did. The output is not necessary, but the commands you used. But IMO something is missing (the .yarn files).

It also helps to put commands in a code block.

I got my hands on a Raspberry Pi 4 with 8 GB of RAM and tried this myself. I followed the exact steps I laid out in the blog post I made and was able to successfully connect to the admin web ui.

trying to make it simpler:
I followed the kcrawford blog:
mkdir -p /opt/joplin/packages/{fork-sax,lib,server}
mkdir -p /opt/joplin/.yarn
chown -R joplin:joplin /opt/joplin
su -l joplin
cp -r /home/joplin/joplin/gulpfile.js .
cp -r /home/joplin/joplin/tsconfig.json .
cp -r /home/joplin/joplin/package.json .
cp -r /home/joplin/joplin/packages/turndown /opt/joplin/packages/turndown
cp -r /home/joplin/joplin/packages/turndown-plugin-gfm /opt/joplin/packages/turndown-plugin-gfm
cp -r /home/joplin/joplin/packages/fork-htmlparser2 /opt/joplin/packages/fork-htmlparser2
cp -r /home/joplin/joplin/packages/server/package.json /opt/joplin/packages/server/*
cp -r /home/joplin/joplin/packages/fork-sax /opt/joplin/packages/fork-sax
cp -r /home/joplin/joplin/packages/fork-uslug /opt/joplin/packages/fork-uslug
cp -r /home/joplin/joplin/packages/htmlpack /opt/joplin/packages/htmlpack
cp -r /home/joplin/joplin/packages/renderer /opt/joplin/packages/renderer
cp -r /home/joplin/joplin/packages/tools /opt/joplin/packages/tools
cp -r /home/joplin/joplin/packages/lib /opt/joplin/packages/lib
cp -r /home/joplin/joplin/packages/server /opt/joplin/packages/server

BUILD_SEQUENCIAL=1 yarn install --inline-builds

but I got an error: yarn workspaces foreach --verbose --interlaced --topological run build && yarn run tsc
error Invalid subcommand.

so I added the additionals files and folders:
cp -r /home/joplin/joplin/.yarn/plugins /opt/joplin/.yarn/plugins
cp -r /home/joplin/joplin/.yarn/releases /opt/joplin/.yarn/releases
cp -r /home/joplin/joplin/.yarnrc.yml .
cp -r /home/joplin/joplin/yarn.lock .

BUILD_SEQUENCIAL=1 yarn install --inline-builds && yarn cache clean && rm -rf .yarn/berry

/opt/joplin$ BUILD_SEQUENCIAL=1 yarn install --inline-builds

and it build succesfully.

Only 1 note: don't know why my installation requires those additional files and folders and why if I copy altogether at first step I got an error and if I copy in two steps it works.

I don't know how to prepare a deb package, but I think it would be great.

Thanks all for the suggestions and support,
Bye

Hi

how did you solve your problem with:

Error: AT joplin/libAT npm:~2.10: No candidates found

I have the same error.

Debian 11
npm --version
9.3.0
yarn --version
3.3.1
node --version
v18.13.0
gulp --version
CLI version: 2.3.0
Local version: Unknown

my commands:

apt update && apt upgrade
apt install -y git vim curl postgresql make gcc g++
curl -fsSL XXXX://deb.nodesource.com/setup_18.x | bash -
apt update && apt upgrade
apt install nodejs
npm install -g pm2
npm install -g corepack
npm install -g gulp
corepack enable
corepack prepare yarnAT stable --activate
yarn init -2

su - postgres
DBPW="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
psql -c "CREATE DATABASE joplin;"
psql -c "CREATE USER joplin with password '$DBPW';"
psql -c "GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO joplin;"

exit

mkdir -p /opt/joplin/packages/{fork-sax,lib}
mkdir -p /opt/joplin/.yarn
useradd --create-home --shell /bin/bash joplin
chown -R joplin:joplin /opt/joplin
su -l joplin
git clone XXXX://github.com/laurent22/joplin.git

cd /opt/joplin
cp -r /home/joplin/joplin/.yarn/plugins /opt/joplin/.yarn/plugins
cp -r /home/joplin/joplin/.yarn/releases /opt/joplin/.yarn/releases
cp -r /home/joplin/joplin/gulpfile.js /opt/joplin/gulpfile.js
cp -r /home/joplin/joplin/tsconfig.json /opt/joplin/tsconfig.json
cp -r /home/joplin/joplin/package.json /opt/joplin/package.json
cp -r /home/joplin/joplin/.yarnrc.yml /opt/joplin/.yarnrc.yml
cp -r /home/joplin/joplin/yarn.lock /opt/joplin/yarn.lock
cp -r /home/joplin/joplin/packages/turndown /opt/joplin/packages/turndown
cp -r /home/joplin/joplin/packages/turndown-plugin-gfm /opt/joplin/packages/turndown-plugin-gfm
cp -r /home/joplin/joplin/packages/fork-htmlparser2 /opt/joplin/packages/fork-htmlparser2
cp -r /home/joplin/joplin/packages/fork-sax /opt/joplin/packages/fork-sax
cp -r /home/joplin/joplin/packages/fork-uslug /opt/joplin/packages/fork-uslug
cp -r /home/joplin/joplin/packages/htmlpack /opt/joplin/packages/htmlpack
cp -r /home/joplin/joplin/packages/renderer /opt/joplin/packages/renderer
cp -r /home/joplin/joplin/packages/tools /opt/joplin/packages/tools
cp -r /home/joplin/joplin/packages/lib /opt/joplin/packages/lib
cp -r /home/joplin/joplin/packages/server /opt/joplin/packages/server

BUILD_SEQUENCIAL=1 yarn install --inline-builds && yarn cache clean && rm -rf .yarn/berry

Hi @kcrawford,

I'm a bit worried about the following DDL statements, due to their security implications:

CREATE DATABASE joplin;
CREATE USER joplin with password 'supers$cret';
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO joplin;

Shouldn't they be rather something like:

REVOKE ALL PRIVILEGES ON SCHEMA public FROM PUBLIC;
CREATE DATABASE joplin;
CREATE USER joplin with password 'supers$cret';
GRANT ALL PRIVILEGES ON DATABASE joplin to joplin;
1 Like

Good call out, I have updated the post with this recommendation as well as provided a method for generating a secure password.

1 Like