# Webclipper port with joplin terminal

**URL:** <https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440>\
**Category:** Features\
**Created:** [8 September 2019 14:46 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440 "2019-09-08T14:46:47Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![foxmask](https://avatars.discourse-cdn.com/v4/letter/f/c68b51/32.png) [@foxmask](https://discourse.joplinapp.org/u/foxmask)\
**Post date:** [8 September 2019 14:46 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/1 "2019-09-08T14:46:47Z")

</div>

Could it be possible to open the port of the webclipper when using joplin terminal ?  
Thus we won’t have to start the Joplin Desktop and thus [joplin-web](https://discourse.joplinapp.org/t/joplin-web-web-application-companion-for-joplin/555/25) could be used on a dedicated hosting services too.  
Today all run on a workstation which blocks [some users for joplin-web](https://github.com/foxmask/joplin-web/issues/23#issuecomment-529173184)

---

<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:** [8 September 2019 15:41 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/2 "2019-09-08T15:41:16Z")

</div>

It’s still the same issue, we’d need to finish the headless server feature: [https://github.com/laurent22/joplin/tree/headless-server](https://github.com/laurent22/joplin/tree/headless-server)

---

<div class="post-metadata">

**Author:** ![foxmask](https://avatars.discourse-cdn.com/v4/letter/f/c68b51/32.png) [@foxmask](https://discourse.joplinapp.org/u/foxmask)\
**Post date:** [8 September 2019 15:43 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/3 "2019-09-08T15:43:18Z")

</div>

ha I knew something existed about it but did not find it.

Hope to see it soon 🙂  
THanks for all the work!

---

<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:** [8 September 2019 16:26 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/4 "2019-09-08T16:26:07Z")

</div>

I’ve added the `server` command in v145, could you give it a try?

```
server <command>

    Start, stop or check the API server. To specify on which port it should run, set the api.port
    config variable. Commands are (start|stop|status). This is an experimental feature - use at your
    own risks! It is recommended that the server runs off its own separate profile so that no two
    CLI instances access that profile at the same time. Use --profile to specify the profile path.

```

For example, in one terminal you can run `joplin server start`, and in another `joplin server status` to check the status or `joplin server stop` to stop the server. You can also make the server run in background using `joplin server start &`.

---

<div class="post-metadata">

**Author:** ![foxmask](https://avatars.discourse-cdn.com/v4/letter/f/c68b51/32.png) [@foxmask](https://discourse.joplinapp.org/u/foxmask)\
**Post date:** [8 September 2019 17:22 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/5 "2019-09-08T17:22:31Z")

</div>

Thanks, I’ll try this evening

---

<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:** [8 September 2019 19:07 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/6 "2019-09-08T19:07:30Z")

</div>

A post was split to a new topic: [CLI error updating from 141 to 145](https://discourse.joplinapp.org/t/cli-error-updating-from-141-to-145/3447)

---

<div class="post-metadata">

**Author:** ![foxmask](https://avatars.discourse-cdn.com/v4/letter/f/c68b51/32.png) [@foxmask](https://discourse.joplinapp.org/u/foxmask)\
**Post date:** [8 September 2019 22:46 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/7 "2019-09-08T22:46:02Z")

</div>

the server start but ignore the token parms

```auto
00:43:39 [foxmask@localhost:~] 1 $ joplin server start
2019-09-09 00:43:48: "Starting Clipper server on port 41184"
2019-09-09 00:43:54: "Request: GET /folders/?token=fff6170db0bbb65ff563fc5977d533a0b4a60ce3203b8c6252f500fbf9e37211a056dcc8f7cf6239e8745a90bd62da0ff328fcc6e8162552139e382301520ca8&fields=id%2C+title%2C+created_time%2C+updated_time%2C+user_created_time%2C+user_updated_time%2C+encryption_cipher_text%2C+encryption_applied%2C+parent_id"
2019-09-09 00:43:54: "Request: GET /tags/?token=fff6170db0bbb65ff563fc5977d533a0b4a60ce3203b8c6252f500fbf9e37211a056dcc8f7cf6239e8745a90bd62da0ff328fcc6e8162552139e382301520ca8"
2019-09-09 00:43:54: "Error: Invalid "token" parameter
Error: Invalid "token" parameter
    at Api.checkToken_ (/home/foxmask/.joplin-bin/lib/node_modules/joplin/lib/services/rest/Api.js:180:49)
    at Api.defaultAction_ (/home/foxmask/.joplin-bin/lib/node_modules/joplin/lib/services/rest/Api.js:184:8)
    at Api.action_tags (/home/foxmask/.joplin-bin/lib/node_modules/joplin/lib/services/rest/Api.js:301:15)
    at Api.route (/home/foxmask/.joplin-bin/lib/node_modules/joplin/lib/services/rest/Api.js:138:42)
    at execRequest (/home/foxmask/.joplin-bin/lib/node_modules/joplin/lib/ClipperServer.js:157:39)
    at Server.server_.on (/home/foxmask/.joplin-bin/lib/node_modules/joplin/lib/ClipperServer.js:199:7)
    at Server.emit (events.js:198:13)
    at parserOnIncoming (_http_server.js:677:12)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)"

```

---

<div class="post-metadata">

**Author:** ![foxmask](https://avatars.discourse-cdn.com/v4/letter/f/c68b51/32.png) [@foxmask](https://discourse.joplinapp.org/u/foxmask)\
**Post date:** [9 September 2019 08:54 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/8 "2019-09-09T08:54:39Z")

</div>

I made another try and it’s working

I did not start the server with the expected profile path

```auto
 joplin --profile ~/.config/joplin-desktop/ server start

```

looks better !

Thanks a lot !!

---

<div class="post-metadata">

**Author:** ![steve28](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@steve28](https://discourse.joplinapp.org/u/steve28)\
**Post date:** [24 November 2019 03:17 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/9 "2019-11-24T03:17:51Z")

</div>

For over a decade now I have been using Evernote with a wireless scanner to archive the various “important” snail mail items we get. I could drop a document into the scanner, it would upload that to a folder on my desktop mac, which in turn would cause a script to launch Evernote and add the document as a new note to the Inbox notebook.

The end result is anyone in the family could send a doc, receipt, etc. to Evernote with one button push and Evernote would OCR it so it was searchable. This worked great.

I am trying to move to self-hosting with Joplin and I desire to re-create this wonderful setup. Another problem is my scanner will no longer upload to my mac in the latest MacOS (Catalina).

Ok - here’s what I got set up:

GOAL: Drop a document into a scanner, hit scan, doc appears OCR’d in Joplin’s synced storage in Nextcloud.

My Setup:

- Intel NUC (headless) running Ubuntu and Docker
- I created a docker container with rest\_uploader, all the dependencies for OCRing and Joplin CLI.

How I run it:

- Run `joplin &` (starts an instance of the joplin CLI)
- Run `joplin server start &` (gets the clipper API running)
- Run `rest_uploader /my_watch_dir`

So at this point, when a new doc hits /my\_watch\_dir, it fires up rest\_uploader, which OCRs the doc, and uploads to joplin server. The “regular” joplin instance ‘sees’ the new note and syncs with Nextcloud. My Mac syncs with nextcloud and so a few minutes after hitting “scan” I have what I want.

My question is - Is this the “simplest” I can make it? I have to run two instances of joplin (server and regular) to make this work… is there any way the server can “sync” without needing a second instance of Joplin? The Joplin CLI doesn’t seem to listen for the clipper API - or am I missing something?

---

<div class="post-metadata">

**Author:** ![marcush](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/marcush/32/1824_2.png) [@marcush](https://discourse.joplinapp.org/u/marcush)\
**Post date:** [12 December 2019 03:17 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/10 "2019-12-12T03:17:58Z")

</div>

I’ve been able to somewhat get this working with just the webclipper service and cron in a docker container. I’ve got some other changes in this branch, but I’m hoping to get something clean up this weekend that I can link to in the forum. Note: I don’t have rest\_uploader in my image, but I think the same principle will apply.

Essentially, I’m doing about the same thing, but instead of starting up joplin cli with `joplin`, I’ve created a cron job that runs `joplin sync`. I’m not sure if this is better, but it does appear to be mostly working for me.

Rough outline of my Dockerfile is:

1. Build joplin from source (working with a slightly modified version)
2. Setup cron
3. Start joplin server
4. (Rest\_uploader?)

---

<div class="post-metadata">

**Author:** ![Shamp0o](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@Shamp0o](https://discourse.joplinapp.org/u/Shamp0o)\
**Post date:** [24 January 2020 14:50 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/11 "2020-01-24T14:50:56Z")

</div>

I already asked this question in the other [thread](https://discourse.joplinapp.org/t/file-uploader-and-ocr/719/45) but didn’t get an answer yet so here’s another shot.

When a new note is created by rest\_uploader the regular instance of joplin CLI doesn’t automatically detect the change and hence doesn’t sync. I have to manually sync via `joplin sync` in order to make the sync happen.  
I’d like to avoid running a cron job that syncs every 5 or so minutes as this drives my cpu usage up to around 80% for a few seconds which will impact the performance of other services running on the same host.

@laurent is Joplin CLI supposed to automatically sync whenever there’s a new note?

---

<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:** [24 January 2020 15:05 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/12 "2020-01-24T15:05:55Z")

</div>

> [@Shamp0o](#):
>
> @laurent is Joplin CLI supposed to automatically sync whenever there’s a new note?

Yes

---

<div class="post-metadata">

**Author:** ![Shamp0o](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@Shamp0o](https://discourse.joplinapp.org/u/Shamp0o)\
**Post date:** [27 January 2020 16:27 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/13 "2020-01-27T16:27:17Z")

</div>

Little update: Auto sync works just fine as long as I don’t run joplin CLI in the background.  
With `joplin &` auto sync is no working for some reason (process is running)  
Running `joplin` in a screen session or as a supervisor daemon has been working without issues so far.

---

<div class="post-metadata">

**Author:** ![jspiers](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/jspiers/32/7128_2.png) [@jspiers](https://discourse.joplinapp.org/u/jspiers)\
**Post date:** [8 February 2021 21:06 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/14 "2021-02-08T21:06:46Z")

</div>

I'm trying to set up a headless Joplin server running in a Docker container using the "joplin server start" command, with the goal of being able to interact with the web clipper API remotely (i.e. from another Docker container).  
I notice that there is an "api.port" setting which can be configured via "joplin config", however the server's bind address is [hard-coded to '127.0.0.1'](https://github.com/laurent22/joplin/blob/3a8aea1aa43d16d863aa0ecd6603570a429c625a/packages/lib/ClipperServer.js#L214), which makes it impossible to access it from outside the Docker container.  
Could you please consider adding an "api.host" configuration setting that would enable binding to "0.0.0.0"?

The goal here being to set up a headless server running in the cloud to facilitate integration with [n8n.io](https://n8n.io/) or Zapier: specifically, a cloud-based "email to Joplin" workflow, where emails sent to an IMAP email inbox get added to Joplin as notes. I've got this mostly working by installing Joplin alongside [n8n.io](http://n8n.io) in the same Docker image, but it would be much cleaner to have a separate headless Joplin container listening on 0.0.0.0.

Let me know if I'm making sense. 🙂

EDIT: Just noticed [this thread](https://discourse.joplinapp.org/t/web-clipper-is-now-available-beta-feature/154/24). Have security issues been resolved with the use of the "api.token", such that (optional) use of 0.0.0.0 with a required secret token would be secure enough? I'm by no means a security expert, but it seems so to me. Cheers.

---

<div class="post-metadata">

**Author:** ![jspiers](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/jspiers/32/7128_2.png) [@jspiers](https://discourse.joplinapp.org/u/jspiers)\
**Post date:** [15 February 2021 03:47 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/15 "2021-02-15T03:47:43Z")

</div>

@laurent @tessus In the meantime, I've resorted to running an nginx reverse proxy in the same container as the headless joplin web clipper, with a cron job for syncing:

> **[jspiers/headless-joplin](https://github.com/jspiers/headless-joplin)**
>
> Dockerized Joplin terminal client. Contribute to jspiers/headless-joplin development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![jspiers](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/jspiers/32/7128_2.png) [@jspiers](https://discourse.joplinapp.org/u/jspiers)\
**Post date:** [22 February 2021 04:46 UTC](https://discourse.joplinapp.org/t/webclipper-port-with-joplin-terminal/3440/16 "2021-02-22T04:46:27Z")

</div>

Updated: now using socat instead of nginx for the 0.0.0.0:80 =\> 127.0.0.1:41184 port forward of the dockerized Joplin clipper server container
