Installing Nemo,

51 views
Skip to first unread message

Salem Akid

unread,
Apr 17, 2025, 9:50:09 AMApr 17
to nemo
Hi everyone,Ā 
Ā  I am trying to install Nemo on my Ubuntu server, which is installed on a laptop. Trying to gain some hands-on experience before implementing it in a pilot project. I'm not a developer, I'm more of an IT architect and infrastructure. I have already installed Nemo on my standalone server (not part of a domain). The installation did not involve configuring LDAP or SSL, and I followed the steps I documented during the installation. Although the I was able to make it works, it was not straightforward and required considerable troubleshooting, which I did not include in my documented steps.Ā  I don't yet feel comfortable moving forward with the pilot implementation .

Could you please review these steps and advise if there is a way to refine them?, or if you have any other high-level implementation steps I could follow?


1- sudo apt update && sudo apt upgrade -y

2- sudo apt install -y python3 python3-pip python3-venv git postgresql postgresql-contrib nginx

3- sudo -u postgres psql

4- Created db and user

5- git clone https://github.com/usnistgov/NEMO.git
6- python3 -m venv venv
7-source venv/bin/activate

8- pip install --upgrade pip

Ā 9- Update the db in settings.py

database:

10- update the static path in settings.py

11- updated the db user permission:

ALTER SCHEMA public OWNER TO sql user;

ALTER SCHEMA public OWNER TO sql user;

Ā 12- install the following packages:Ā 

sudo pip install django-filter --break-system-packages

sudo pip install django-mptt --break-system-packages

pip install django-mptt
pip install django-auditlog

pip install packaging

pip install drf-excel

pip install drf-flex-fields

pip install ldap3

pip install pymodbus

Ā 

13- run python3 manage.py migrate

14- python manage.py createsuperuser

15-pip install gunicorn

gunicorn --workers 3 --bind 127.0.0.1:8001 NEMO.wsgi:application

Ā 16- sudo nano /etc/nginx/sites-available/nemo

server {
Ā  Ā  listen 80;
Ā  Ā  server_name localhost;

Ā  Ā  location = /favicon.ico { access_log off; log_not_found off; }
Ā  Ā  location /static/ {
Ā  Ā  Ā  Ā  alias /home/nemo/NEMO/static/;
Ā  Ā  }

Ā  Ā  location / {
Ā  Ā  Ā  Ā  proxy_pass http://127.0.0.1:8001;
Ā  Ā  Ā  Ā  proxy_set_header Host $host;
Ā  Ā  Ā  Ā  proxy_set_header X-Real-IP $remote_addr;
Ā  Ā  }
}

Ā 

18- sudo ln -s /etc/nginx/sites-available/nemo /etc/nginx/sites-enabled/


'

Your help will be highly appreciated itĀ 

Ā 



mathieu...@gmail.com

unread,
Apr 17, 2025, 5:21:26 PMApr 17
to nemo, akid....@gmail.com
Hi,
I would definitely look at using the docker image and not installing it from pip yourself.
or even better with docker-compose:

Then with docker compose you can add a service with postgres as well, and use an init script to create the database and user:
CREATE USER nemo WITH ENCRYPTED PASSWORD '<password>';
ALTER ROLE nemo SET client_encoding TO 'utf8';
ALTER ROLE nemo SET default_transaction_isolation TO 'read committed';
ALTER ROLE nemo SET timezone TO 'UTC';
CREATE DATABASE nemo OWNER nemo;

You might have to read some docs about docker and containers etc.

Good luck,
Mathieu

Salem Akid

unread,
Apr 17, 2025, 9:02:05 PMApr 17
to mathieu...@gmail.com, nemo
Ā  Thank you, Mathieu, for the advice. I tried using a Docker image, and everything went well. However, I got stuck at the end with the login credentials. I created a superuser, but it was created without a password, and I wasn't able to login.Ā 

mathieu...@gmail.com

unread,
Apr 18, 2025, 8:26:58 AMApr 18
to nemo, akid....@gmail.com, nemo, mathieu...@gmail.com
Right, NEMO doesn't do authentication itself so there are no passwords stored in NEMO.

With docker/docker-compose, you can force the username in nginx (for testing purposes) using the following:

in settings.py:
  1. make sure you have 'NEMO.middleware.HTTPHeaderAuthenticationMiddleware', in the list of middlewares.
  2. use AUTHENTICATION_BACKENDS = ['NEMO.views.authentication.RemoteUserAuthenticationBackend']
  3. use AUTHENTICATION_HEADER = "AUTHORIZATION"
in nginx.conf:
  • use "proxy_set_header Authorization <your_username>;"
in production you want to set up nginx for shibboleth or kerberos and use the remote-user to send the username to NEMO, or use the NEMO-allauth plugin to connect to a supported provider, or use LDAP.

Salem Akid

unread,
Apr 18, 2025, 7:04:13 PMApr 18
to mathieu...@gmail.com, nemo
Thank you again for helpful detailšŸ™, I did address these three lines for on my settings.py then I got another Authentication error on my browser. Maybe I did something wrong, I’ll try again.
Reply all
Reply to author
Forward
0 new messages