OliveTin Gives Your Users a Web-Based Remote Control for Your Raspberry Pi Server

If you’re running a Raspberry Pi as a home server, it’s likely that friends and family access its services too. Occasionally, they’ll need to run some routine tasks which require limited control of the server.

OliveTin is a self-hosted app which they can access through a web browser to execute predetermined commands and scripts defined by you.

4

Why Use OliveTin on Raspberry Pi?

The Raspberry Pi series of single-board computers make for excellent lightweight home servers, and it’s relatively easy toset up a Raspberry Pi web server.

In addition to hosting websites and blogs, yourRaspberry Pi can host photo galleries, cookbooks, and online office suites. You canstream movies and shows to your TV with Jellyfin, orself-host an audiobook library with Audiobookshelf.

Olive Tin screenshot on an iPhone screen

You’re not limited to the number of users it’s possible to have either, so unless you live alone, you probably share access to your Raspberry Pi services with other members of your household.

Servers, like any other type of computer, need occasional maintenance. Your users may need tostart or stop particular services,connect to a VPN,back up files on Raspberry Pi, orcheck for network problems.

Friends sitting on the couch and watching film

If your family and housemates arefamiliar with the Linux command line, and you trust them not to accidentally or deliberately bork your system, you may consider giving them their own SSH credentials along withsudo group membership, so they can carry out these tasks without bothering you.

It’s a tempting but dangerous proposition, and if something goes wrong, it’s you who’s going to have to fix it. With OliveTin, you can define routine commands that other server users may need to carry out regularly. They can then open a web browser, and hit a button which will run the command on your Pi—without ever needing to touch the command line.

olive tin docker-compose file

How to Install OliveTin on Raspberry Pi

The easiest way to install OliveTin is using Docker Compose. If you don’t already have Docker and Docker Compose installed on your Raspberry Pi, check out our essential guide onhow to install Docker and Docker Compose on Linux.

Connect to your Raspberry Pi server usingSecure Shell (SSH):

olive tin web interface with six icons

Create a new directory for OliveTin, and use thecdcommand to move into it:

Use the nano text editor to create a new Docker Compose file:

Copy and paste in the following:

Now save and exit nano withCtrl + OthenCtrl + X.

Before you run OliveTin for the first time, you need to create a config file. This is where you will define the commands for users to run. For now, enter:

Use OliveTin to Give Your Users Limited Server Control

In your terminal, enter:

This command will bring up Docker Compose in detached mode. Docker Compose will download the images for OliveTin and set up containers. This process may take some time. When you’re returned to the command prompt, check everything is running correctly with:

Open a browser, and navigate toyour-pi-local-ip-adress:1337. You should see a gray web page with the OliveTin footer. You’re now ready to start defining commands for your users.

Back in the terminal, use nano to edit the config file you created earlier:

Syntax is simple, and you can define the name of the services and the actions to be performed similarly to the following example:

The titlefield is the title that users can see, while the command followingshell:is the command that will actually be carried out on your Raspberry Pi.

OliveTin supports unicode icons, and you may specify the HTML code of these in theiconsection. Alternatively, you can set the full URL of an image you want to use. For instance:

While our config gives examples which will restart the Raspberry Pi, restart Apache, and ping Netflix, there’s really no limit to what commands it’s possible to specify. You can give users a button which will copy movies from one directory to another, quickly wipe and overwrite certain directories, or build a kill-switch which will encrypt your storage devices with a random key.

When you’re happy with your config, save the file and exit nano by pressingCtrl + OthenCtrl + X.

Any stdout produced as a result of button presses is logged. You can see the logs by pressing theLogsbutton in the top right. With OliveTin, you can also allow users to give commands, known as arguments, through the web interface—either with a text box, or with drop-down choices.

Because of the danger associated with letting inexperienced users issue privileged arbitrary commands directly to your Raspberry Pi server, you can restrict the type of argument OliveTin will accept.

For quick reference, the types are:

Accepted values

very_dangerous_raw_string

As the name suggests, the user will be able to input any text or command and have it carried out

Any whole positive number

Any characters or number, but no spaces or punctuation

ascii_identifier

For DNS and similar

ascii_sentence

a-z , 0-9, with spaces,.and,

A web address

A text box definition in yourconfig.yamlfile is formatted as below:

The text box will appear when someone presses the appropriate button, and will allow any user on your local network to execute arbitrary code through the browser. It is not altogether a good idea.

OliveTin Makes It Easy for Users to Perform Basic Tasks on Your Raspberry Pi Server

The Raspberry Pi is the perfect home-server platform for hosting services for your family to use, and OliveTin makes it easy for them to carry out simple maintenance without disturbing you.

There are thousands of self-hosted projects you can run on Raspberry Pi which will benefit your household. Do some research and find out what services you’re paying for which you could host yourself instead!

Replace the services offered by tech giants with these self-hosting DIY projects. The only hardware you need is a Raspberry Pi.

These plugins will make you wonder why you used Photoshop in the first place.

These films will leave you questioning humanity, but also wanting more.

Not all true crime is about hacking, slashing, and gore.

Tor spoiled me forever.

It’s not super flashy, but it can help to keep your computer up and running.

Technology Explained

PC & Mobile