Hosting Solid Server on AWS Lightsail in 15 minutes

A simple hosting tutorial for Node Solid Server

Altynbek Orumbayev
Jan 29 · 3 min read

In this tutorial, you will be guided through a relatively straightforward set of steps to host your own instance of a Solid server. Specifically, using node-solid-server, which is probably the most actively supported implementation of a Solid server.

About Solid project

The term `Solid` stands for Social Linked Data and is a project led by Sir Tim Berners-Lee. The goal is simple yet ambitious, decentralize World Wide Web and decouple data from the applications on the web, resulting in users having more control over their data. Find out more about the solid project on their official website.

Prerequisites

The following list of prerequisites is required to be set up before proceeding to further steps of the guide:

1. Install nvm

The first step is to connect to your Lightsail instance and setup node. One simple and fast way to do so is to use the Node Version Manager. Execute the following command to run the official nvm install script.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash

Once executed and configured, run the following command to install and use the specific node version:

nvm install v12 # v12 is not mandatory, choose anything starting from v8

2. Install and configure solid-server

Create a sample folder at home directory in your AWS Lightsail instance and install node-solid-server locally. You can, optionally, install it globally, but I personally always had issues when switching different versions of NSS. Therefore it is easier to fix issues manually when having packages installed locally.

2.1 Create SSL certificates using certbot:

Firstly let’s download and install certbot:

sudo apt-get install software-properties-common

Generate the certificates for your domain:

sudo certbot certonly — manual — preferred-challenges=dns — email {YOUR_EMAIL_GOES_HERE} — server https://acme-v02.api.letsencrypt.org/directory — agree-tos -d *.{YOUR_DOMAIN_TITLE_GOES_HERE}

The certificates will be available under the following path afterwards:

/etc/letsencrypt/live/{YOUR_DOMAIN_TITLE_GOES_HERE}/privkey.pem

2.1 Install NSS:

npm install solid-server

2.2. Create server configuration file:

npx solid init

Follow the command prompts from CLI. The important part is to provide the correct path to your SSL certificates.

3. Start server

There are many ways to configure auto-execution in Linux. For example using a cron job or /etc/rc.d/rc.local. However, for the sake of testing whether the solution works or not, let’s temporarily start the server in the background using tmux and attempt to access it via domain URL and default port 8443.

tmux
npx solid start

Afterward, the server should become available at https://{yourdomain}:8443.

Recap

Solid project is still in the early stages, but it has a friendly community. The following is the list of most useful places you can refer to for any question on Solid project and related development tools, frameworks and libraries:

Please note, certain parts of this article are still WIP.

Altynbek Orumbayev

Written by

💻 Software Developer | ☕ Coffee addict | https://github.com/aorumbayev

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade