# Install Joplin Server without docker in Proxmox

**URL:** <https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472>\
**Category:** Development\
**Tags:** how-to\
**Created:** [22 September 2021 23:07 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472 "2021-09-22T23:07:40Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kcrawford](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@kcrawford](https://discourse.joplinapp.org/u/kcrawford)\
**Post date:** [22 September 2021 23:07 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/1 "2021-09-22T23:07:40Z")

</div>

# Please note: This guide is partly obsolete. npm is no longer used to build the server. See [Dockerfile.server](https://github.com/laurent22/joplin/blob/dev/Dockerfile.server) for the correct steps.

* * *

Hello forum,

Here are the steps I took to install Joplin Server inside of an LXC container running in Proxmox. I used Debian 11 as the base image, checked the box for unprivileged container and nesting. I would be grateful if others could try this as well and let me know if you run into any issues.

1. Install needed packages

```auto
apt install -y git vim curl postgresql-13 python2.7 make gcc g++ apache2
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
apt update
apt upgrade
apt install nodejs
npm install -g pm2

```

1. Generate https certs, be sure to enter the IP address of the server as the Common Name

```auto
openssl req -x509 -nodes -days 10000 -newkey rsa:4096 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt

```

1. Switch to postgres user to create database

```auto
su postgres
psql

```

```auto
CREATE DATABASE joplin;
CREATE USER joplin with password 'joplinrocks';
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO joplin;

```

1. As root, create joplin directory and joplin user

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

```

1. Copy needed files from git repo

```auto
cp joplin/packages/fork-sax/package*.json /opt/joplin/packages/fork-sax/
cp joplin/packages/lib/package*.json /opt/joplin/packages/lib/
cp joplin/lerna.json /opt/joplin/
cp joplin/tsconfig.json /opt/joplin/
cp joplin/package*.json /opt/joplin/
cp -r joplin/packages/fork-htmlparser2/ /opt/joplin/packages/
cp -r joplin/packages/turndown-plugin-gfm/ /opt/joplin/packages
cp -r joplin/packages/turndown/ /opt/joplin/packages/
cp -r joplin/packages/renderer/ /opt/joplin/packages/
cp -r joplin/packages/server/ /opt/joplin/packages/
cp -r joplin/packages/tools/ /opt/joplin/packages/
cp -r joplin/packages/lib /opt/joplin/packages/

```

1. Build application using npm

```auto
cd /opt/joplin/
npm config set python python2.7
npm install --ignore-scripts
npm run bootstrap
npm run bootstrapServerOnly
npm run build
npm install jquery
npm i @fortawesome/fontawesome-free

```

1. Create autostart file for PM2 to use

```auto
joplin@joplin-server:~$ cat /opt/joplin/packages/server/ecosystem.config.js
module.exports = {
  apps : [
      {
        name: "joplin-server",
        script: "/opt/joplin/packages/server/dist/app.js",
        watch: false,
        env: {
          "DB_CLIENT": "pg",
      "POSTGRES_DATABASE": "joplin",
      "POSTGRES_PASSWORD": "joplinrocks",
      "POSTGRES_USER": "joplin",
      "APP_BASE_URL": "https://<your ip>/joplin",
      "NODE_ENV": "development"
        }
      }
  ]
}

joplin@joplin-server:~$

```

1. Add cron to joplin user to autostart server on boot

```auto
@reboot sh -c 'cd /opt/joplin/packages/server/ && pm2 start /opt/joplin/packages/server/ecosystem.config.js'

```

1. Switch back to root user and enable proxy services in Apache

```auto
a2enmod proxy
a2enmod proxy_http
a2enmod ssl

```

1. Create reverse proxy in Apache

```auto
root@joplin-server:~# cat /etc/apache2/sites-available/000-default-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    ProxyPreserveHost On
    ProxyPass "/joplin" http://localhost:22300
    ProxyPassReverse "/joplin" http://localhost:22300

    ServerName <your ip>
    SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
    SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key

    SSLEngine on

    # Intermediate configuration, tweak to your needs
    SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
    SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
    SSLHonorCipherOrder off
    SSLSessionTickets off

    SSLOptions +StrictRequire

    # Add vhost name to log entries:
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" vhost_combined
    LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common
</VirtualHost>
</IfModule>
root@joplin-server:~#

```

1. Enable site

```auto
a2ensite 000-default-ssl

```

1. Reboot

---

<div class="post-metadata">

**Author:** ![ElHado](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/elhado/32/10992_2.png) [@ElHado](https://discourse.joplinapp.org/u/ElHado)\
**Post date:** [19 October 2021 12:24 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/2 "2021-10-19T12:24:00Z")

</div>

Hi,  
I tested your tutorial and I found one error at the moment I want to start the server:

```auto
[PM2][WARN] Applications joplin-server not running, starting...
[PM2][ERROR] Error: Script not found: /home/joplin/packages/server/dist/app.js

```

The error seems okay because we point to no folder. I corrected the path to this first, because in my folder structure I have joplin for the user and then anoter joplin folder for the git download:

/home/joplin/joplin/packages/server/dist/app.js

But error is the same. So I take a look and found out that there is no folder /dist/ in /packages/server/ and I also can't find a file app.js

Can you tell me the content of the file app.js or to which file I have to point for start up the server?

Greetings  
Dominik

---

<div class="post-metadata">

**Author:** ![laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@laurent](https://discourse.joplinapp.org/u/laurent)\
**Post date:** [19 October 2021 12:35 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/3 "2021-10-19T12:35:58Z")

</div>

Maybe tsc compilation failed somewhere. Run npm run tsc from the root to check.

---

<div class="post-metadata">

**Author:** ![ElHado](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/elhado/32/10992_2.png) [@ElHado](https://discourse.joplinapp.org/u/ElHado)\
**Post date:** [19 October 2021 13:26 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/4 "2021-10-19T13:26:14Z")

</div>

Hi,  
I think I found the problem. There is a wrong path in the tutorial, point "7. Create autostart file for PM2 to use"

you have to change this line:

```auto
script: "/home/joplin/packages/server/dist/app.js",

```

to

```auto
script: "/opt/joplin/packages/server/dist/app.js",

```

Now the server is up and running:

```auto
[PM2][Initialization] Environment variable HOME (Linux) or HOMEPATH (Windows) are not set!
[PM2][Initialization] Defaulting to /etc/.pm2
[PM2][WARN] Applications joplin-server not running, starting...
[PM2] App [joplin-server] launched (1 instances)

```

---

<div class="post-metadata">

**Author:** ![kcrawford](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@kcrawford](https://discourse.joplinapp.org/u/kcrawford)\
**Post date:** [19 October 2021 13:43 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/5 "2021-10-19T13:43:17Z")

</div>

Good catch, I must have missed that when writing/updating this. It seems I am also unable to edit the original post, possibly because too much time has passed since writing it.

---

<div class="post-metadata">

**Author:** ![tessus](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/tessus/32/13_2.png) [@tessus](https://discourse.joplinapp.org/u/tessus)\
**Post date:** [19 October 2021 13:49 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/6 "2021-10-19T13:49:50Z")

</div>

Yes, you can only change posts within a certain amount of time.

I've updated your post with the correct path.

---

<div class="post-metadata">

**Author:** ![ElHado](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/elhado/32/10992_2.png) [@ElHado](https://discourse.joplinapp.org/u/ElHado)\
**Post date:** [19 October 2021 13:52 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/7 "2021-10-19T13:52:27Z")

</div>

Thanks for this tutorial anyway. It helped a lot.

Short question for updating the server:

Is it possible to update the git repository, copy all files again and run the npm stuff again to bring my server up to date?

---

<div class="post-metadata">

**Author:** ![ElHado](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/elhado/32/10992_2.png) [@ElHado](https://discourse.joplinapp.org/u/ElHado)\
**Post date:** [20 October 2021 10:22 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/8 "2021-10-20T10:22:49Z")

</div>

Sorry guys, I have an other question. pm2 says the server is running but I can't connect. The pm2 log looks like this:

```auto
PM2 | App [joplin-server:0] exited with code [1] via signal [SIGINT]
PM2 | App [joplin-server:0] starting in -fork mode-
PM2 | App [joplin-server:0] online
0|joplin-server | 2021-10-20 10:18:00: App: Starting server v2.5.2 (prod) on port 22300 and PID 10810...
0|joplin-server | 2021-10-20 10:18:00: App: Running in Docker: false
0|joplin-server | 2021-10-20 10:18:00: App: Public base URL: https://xxx.xx/joplin
0|joplin-server | 2021-10-20 10:18:00: App: API base URL: https://xxx.xx/joplin
0|joplin-server | 2021-10-20 10:18:00: App: User content base URL: xxx.xx/joplin
0|joplin-server | 2021-10-20 10:18:00: App: Log dir: /opt/joplin/packages/server/logs
0|joplin-server | 2021-10-20 10:18:00: App: DB Config: {
0|joplin-server | client: 'pg',
0|joplin-server | name: 'joplin',
0|joplin-server | slowQueryLogEnabled: false,
0|joplin-server | slowQueryLogMinDuration: 10000,
0|joplin-server | user: 'joplin',
0|joplin-server | password: '***',
0|joplin-server | port: 5432,
0|joplin-server | host: 'localhost'
0|joplin-server | }
0|joplin-server | 2021-10-20 10:18:00: App: Trying to connect to database...
0|joplin-server | 2021-10-20 10:18:00: App: Connection check: {
0|joplin-server | latestMigration: { name: '20190913171451_create.js' },
0|joplin-server | isCreated: true,
0|joplin-server | error: null
0|joplin-server | }
0|joplin-server | [Error: EACCES: permission denied, unlink '/opt/joplin/packages/server/temp/joplin.sqlite'] {
0|joplin-server | errno: -13,
0|joplin-server | code: 'EACCES',
0|joplin-server | syscall: 'unlink',
0|joplin-server | path: '/opt/joplin/packages/server/temp/joplin.sqlite'
0|joplin-server | }

```

The server is restarting all the time. What does this error Mean: EACCES: permission denied, unlink....?

I did the setup for postgresql, so why he want to connect to sqlite?

Seem like I miss something.

Thanks for your help...

---

<div class="post-metadata">

**Author:** ![kcrawford](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@kcrawford](https://discourse.joplinapp.org/u/kcrawford)\
**Post date:** [20 October 2021 23:49 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/9 "2021-10-20T23:49:15Z")

</div>

This looks like a password issue between what you configured when setting up the user in Postgres and what is in the `/opt/joplin/packages/server/ecosystem.config.js` file. Try [resetting the password](https://www.postgresql.org/docs/13/sql-alterrole.html) you set for the joplin user in Postgres.

---

<div class="post-metadata">

**Author:** ![ElHado](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/elhado/32/10992_2.png) [@ElHado](https://discourse.joplinapp.org/u/ElHado)\
**Post date:** [3 November 2021 09:30 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/10 "2021-11-03T09:30:56Z")

</div>

Sorry for this late reply. I first tried to fix/set the password for the postgres user to the same like in the ecosystem.config.js file. But this didn't work or I did something wrong.

So I decided to start from scratch today with a complete new Ubutnu 20.04 LTS (used it at the first approach, too).

At `npm run bootstrap` I get this error message: `lerna ERR! npm install exited 1 in '@joplin/server'`

I searched the net and tried some things I found there but I can't find the issue.

I think I haven't enough backround knowledge in building to do it and so stop at this point. Maybe I can do it later if I have some more knowledge about this things.

Thanks for your fast help anyway.

Greetings Dominik

---

<div class="post-metadata">

**Author:** ![tech](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@tech](https://discourse.joplinapp.org/u/tech)\
**Post date:** [20 November 2021 08:20 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/11 "2021-11-20T08:20:35Z")

</div>

Thank you for the guide. I am trying to get this to work but during step 6 (building application), when running `npm run bootstrap`, I get the following error:

```auto
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@joplin%2fhtmlpack - Not found
npm ERR! 404
npm ERR! 404 '@joplin/htmlpack@~2.6' is not in this registry.

```

So it looks like the 2.6 version htmlpack is missing from the repo?  
Searching for the error unfortunately did not yield any useful results. Any hints on how to proceed would be appreciated!

---

<div class="post-metadata">

**Author:** ![Altwazar](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/altwazar/32/11604_2.png) [@Altwazar](https://discourse.joplinapp.org/u/Altwazar)\
**Post date:** [25 November 2021 16:45 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/12 "2021-11-25T16:45:55Z")

</div>

Hi, for solving 'joplin/htmlpack@~2.6' dependency problem you could copy additional package before bootstrap:  
`cp -r joplin/packages/htmlpack/ /opt/joplin/packages/`

---

<div class="post-metadata">

**Author:** ![ElHado](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/elhado/32/10992_2.png) [@ElHado](https://discourse.joplinapp.org/u/ElHado)\
**Post date:** [8 January 2022 20:26 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/13 "2022-01-08T20:26:18Z")

</div>

Hi guys,

tried again today and it seems there is something missing again. Tried it on Debian 11 this time:

```auto
npm install --ignore-scripts --legacy-peer-deps --force
npm WARN using --force Recommended protections disabled.
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@joplin%2ffork-uslug - Not found
npm ERR! 404
npm ERR! 404 '@joplin/fork-uslug@^1.0.4' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/joplin/.npm/_logs/2022-01-08T20_15_11_220Z-debug-0.log
joplin@joplin:/opt/joplin$ npm run bootstrap
npm ERR! Missing script: "bootstrap"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run

npm ERR! A complete log of this run can be found in:
npm ERR! /home/joplin/.npm/_logs/2022-01-08T20_24_29_695Z-debug-0.log

```

Anybody know what to do?

---

<div class="post-metadata">

**Author:** ![tessus](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/tessus/32/13_2.png) [@tessus](https://discourse.joplinapp.org/u/tessus)\
**Post date:** [9 January 2022 03:02 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/14 "2022-01-09T03:02:37Z")

</div>

@kcrawford This guide is great, but I think it needs to be updated or rewritten.

2 things:

- `yarn` is now used in the project
- a section on how to upgrade the server would be nice, even if it only mentions to just repeat steps 5 and 6 with a `git pull` beforehand

I have now added a how-to tag. We can also move it to the #lounge category, if you want.

---

<div class="post-metadata">

**Author:** ![ElHado](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/elhado/32/10992_2.png) [@ElHado](https://discourse.joplinapp.org/u/ElHado)\
**Post date:** [9 January 2022 08:11 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/15 "2022-01-09T08:11:23Z")

</div>

> [@tessus](#):
>
> `yarn` is now used in the project

If anybody can tell me step 6 with yarn I would write a new complete guide for installation.

---

<div class="post-metadata">

**Author:** ![tessus](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/tessus/32/13_2.png) [@tessus](https://discourse.joplinapp.org/u/tessus)\
**Post date:** [9 January 2022 21:52 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/16 "2022-01-09T21:52:52Z")

</div>

The steps are in the Dockerfile. Please note that I used a link to a specific commit hash, because there's a PR in the queue for a multistage build, which probably would only be confusing.

> <https://github.com/laurent22/joplin/blob/39056ae1aafbce71836e7fbd2c60df7687df84ba/Dockerfile.server>

---

<div class="post-metadata">

**Author:** ![ElHado](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/elhado/32/10992_2.png) [@ElHado](https://discourse.joplinapp.org/u/ElHado)\
**Post date:** [11 January 2022 17:15 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/17 "2022-01-11T17:15:16Z")

</div>

@laurent22: Thanks for this info. I tried but got many errors in the last build step. I try to figure out whats going wrong and then I'll write a new tutorial...

---

<div class="post-metadata">

**Author:** ![aspx1981](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/aspx1981/32/15800_2.png) [@aspx1981](https://discourse.joplinapp.org/u/aspx1981)\
**Post date:** [25 December 2022 21:40 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/18 "2022-12-25T21:40:17Z")

</div>

Hello,

I wish to run Joplin server on a Raspberry PI4 to sync many phone/tablet/pc app, and I tried this tutorial and others based on npm to run it without docker, but no luck.  
Is there any new version of this tutorial ?  
or a package source that can be used also for update ?  
thanks

---

<div class="post-metadata">

**Author:** ![aspx1981](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/aspx1981/32/15800_2.png) [@aspx1981](https://discourse.joplinapp.org/u/aspx1981)\
**Post date:** [29 December 2022 15:26 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/19 "2022-12-29T15:26:56Z")

</div>

hello,  
can anyone help ?

after completing point 1,2,3 and 4 I did the 5:  
cp joplin/packages/fork-sax/package\*.json /opt/joplin/packages/fork-sax/  
cp joplin/packages/lib/package\*.json /opt/joplin/packages/lib/  
cp joplin/lerna.json /opt/joplin/  
cp joplin/tsconfig.json /opt/joplin/  
cp joplin/package\*.json /opt/joplin/  
cp -r joplin/packages/fork-htmlparser2/ /opt/joplin/packages/  
cp -r joplin/packages/turndown-plugin-gfm/ /opt/joplin/packages  
cp -r joplin/packages/turndown/ /opt/joplin/packages/  
cp -r joplin/packages/renderer/ /opt/joplin/packages/  
cp -r joplin/packages/server/ /opt/joplin/packages/  
cp -r joplin/packages/tools/ /opt/joplin/packages/  
cp -r joplin/packages/lib /opt/joplin/packages/

adding:  
cp -r joplin/packages/htmlpack/ /opt/joplin/packages/

because the command npm install --ignore-scripts in step 6 complains about its missing, then it completes successfully, but when I try the other commands of step 6:  
npm run bootstrap  
npm run bootstrapServerOnly  
npm run build

they all fail reporting missing option bootstrap, bootstrapserveronly and build

Thanks

---

<div class="post-metadata">

**Author:** ![tessus](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/tessus/32/13_2.png) [@tessus](https://discourse.joplinapp.org/u/tessus)\
**Post date:** [30 December 2022 01:47 UTC](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/20 "2022-12-30T01:47:08Z")

</div>

> [@Install Joplin Server without docker in Proxmox](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472/14):
>
> @kcrawford This guide is great, but I think it needs to be updated or rewritten. 2 things: yarn is now used in the project a section on how to upgrade the server would be nice, even if it only mentions to just repeat steps 5 and 6 with a git pull beforehand I have now added a how-to tag. We can also move it to the #lounge category, if you want.

Please open a new topic.

[Next page](https://discourse.joplinapp.org/t/install-joplin-server-without-docker-in-proxmox/20472.md?page=2)
