# Self-Hosting Scanner

**URL:** https://discussion.scottibyte.com/t/self-hosting-scanner/135
**Category:** Uncategorized
**Created:** [October 24, 2022, 11:17pm UTC](https://discussion.scottibyte.com/t/self-hosting-scanner/135 "2022-10-24T23:17:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![scott](https://discussion.scottibyte.com/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@scott](https://discussion.scottibyte.com/u/scott)
#### Post date: [October 24, 2022, 11:17pm UTC](https://discussion.scottibyte.com/t/self-hosting-scanner/135/1 "2022-10-24T23:17:25Z")

</div>

A vast majority of printers today also have scanning, copying and fax functions. Installing printer drivers is pretty straight forward on most operating systems. Installing programs that allow network scanning are often complex and need to be installed on every computer that requires this capability.

In this tutorial, we learn about a program called “scanservjs” and see that it can be used as a “scanning as a service” function on your network that is easily accessed from any web browser.

After the demo, I go through the steps necessary to install and configure scanservjs in docker. If you have a Docker host, you can easily add this application. If not, you can create a virtual machine or a LXD container to host your scanservjs instance.

I use a LXD container. My LXD container is exposed to my Main LAN through bridging which is frequently discussed on the channel. Assuming you have a bridge called “bridge0” and a LXD profile called “Bridged-MAIN”, here is the command I used to create a LXD container on my LXD host:

```auto
lxc launch ubuntu:22.04 Scan-test --profile default --profile Bridged-MAIN -c limits.memory=4096MB -c limits.cpu.allowance=20% -c boot.autostart=true -c security.privileged=true -c security.nesting=true

```

To enter the lxd host console:

```auto
lxc exec Scan-test bash

```

I created a user account, gave it sudo privilege, installed docker, docker-compose, and net-tools as in the video. You may need sudo before each of the following if you are not in the root account:

```auto
adduser scott
usermod -aG sudo scott
curl -sSL https://get.docker.com | sh
usermod -aG docker scott
apt install docker-compose
apt install net-tools
su - scott

```

On the docker host, add SANE support:

```auto
sudo apt install libsane

```

Scan for your scanners:

```auto
scanimage -L

```

Create a folder to install the application and move into it:

```auto
mkdir scanner
cd scanner

```

Edit the docker-compose file.

```auto
nano docker-compose.yml

```

Put the following contents into the docker-compose.yml file. Adjust the port 80, it it is in use on your docker host:

```auto
version: '3'
services:
  scanner:
    container_name: scanner
    privileged: true
    image: 'sbs20/scanservjs:latest'
    restart: unless-stopped
    ports:
      - '80:8080'
    volumes:
      - /var/run/dbus:/var/run/dbus
      - ./scannedfiles:/var/lib/scanservjs/output
      - ./config:/app/config

```

Start the scanservjs application:

```auto
docker-compose up -d

```

Navigate to the ip address of your docker server in a browser using the port number if you changed the port 80 in my configuration file.

---

<div class="post-metadata">

### Author: ![Jim.Smith.Sr](https://discussion.scottibyte.com/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@Jim.Smith.Sr](https://discussion.scottibyte.com/u/Jim.Smith.Sr)
#### Post date: [September 8, 2024, 4:55am UTC](https://discussion.scottibyte.com/t/self-hosting-scanner/135/2 "2024-09-08T04:55:41Z")

</div>

I am the only person on my network using the scanner because it is about 6 feet to my left, but this might be good for clients  
😀
