-
Notifications
You must be signed in to change notification settings - Fork 0
Manual Installation
This very rough in progress document outlines the basic process of setting up MongoDB, Node.js, Redis Server, and mugsyOS on a Raspberry Pi.
- This is an incomplete walk though and a lot of these commands are not meant for a production system.
- This is meant only to be a rough starting point for documentation while I finalize things like application installation locations, build scripts and remove any non-standard or hacky bits from the process. You should consider this doc only as a rough outline that illustrates some of the primary systems required to run mugsyOS, and not as a completed guide ready to be followed.
- This set up does not include any process management steps, so there is no automatic or service based application startup, etc.
- mugsyOS will not live in /var.
- Several steps are not included yet!
-
Update the package lists for upgrades and new package installations:
sudo apt update sudo apt upgrade
-
Import the MongoDB public GPG key used by the package management system:
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - -
Update the package lists again:
sudo apt-get update
-
Install the MongoDB packages:
sudo apt-get install -y mongodb-org=4.4.17 mongodb-org-server=4.4.17 mongodb-org-shell=4.4.17 mongodb-org-mongos=4.4.17 mongodb-org-tools=4.4.17
-
Verify the installed MongoDB version:
mongod --version
-
Reload the system manager configuration:
sudo systemctl daemon-reload
-
Enable MongoDB to start on boot:
sudo systemctl enable mongod -
Start MongoDB:
sudo systemctl start mongod
-
Check MongoDB's status:
sudo systemctl status mongod
-
Access the MongoDB shell:
mongo
-
Open the MongoDB configuration file with a text editor (like nano):
sudo nano /etc/mongod.conf
TODO: add authorization configuration here. -m
After editing the file, restart MongoDB:
sudo systemctl restart mongod
And access the MongoDB shell again:
mongo
-
If you have MongoDB user credentials, you can log in using:
mongo -u "admin" -p "******************************"
-
Deleted -m
-
Deleted -m
-
Deleted -m
-
Deleted -m
-
Install Node.js:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - sudo apt install nodejs -
Install Redis server:
sudo apt install redis-server
-
Create directories for the backend of your application:
sudo mkdir -p /var/mugsyOS/backend/{dev,prod} -
Change directory to
/var/mugsyOS/backend/dev:cd /var/mugsyOS/backend/dev/ -
Clone your application repository:
sudo git clone https://github.com/******/******.git
-
Change directory into the cloned repository and inspect its contents:
cd decaf/ ls -
Review the
requirements.txtfile for Python dependencies:cat requirements.txt
-
Check your Python and Pip versions:
python --version pip --version
-
Install Python virtual environment:
sudo apt-get install python3-venv
-
Create a virtual environment and activate it:
sudo python -m venv decaf source decaf/bin/activate -
Install Python dependencies:
pip3 install -r requirements.txt
-
Run your application using Uvicorn:
uvicorn main:app --reload --host mugsySolo.local
-
If needed, grant full permissions to your application directory: DO NOT DO THIS!
sudo chmod -R 777 decaf/
-
Create a directory for the frontend of your application and grant full permissions: DO NOT DO THIS!
sudo mkdir -p /var/mugsyOS/frontend/dev sudo chmod -R 777 /var/mugsyOS/frontend/
-
Clone your frontend repository:
cd /var/mugsyOS/frontend/dev/ git clone https://github.com/******/******.git
-
Install the npm dependencies for the frontend application:
cd mugsyFrontend/ npm install -
Start the frontend application:
npm start
-
Deleted -m
-
After rebooting, navigate back to your backend and frontend directories to restart your applications:
cd /var/mugsyOS/backend/dev/decaf/ uvicorn main:app --reload --host mugsySolo.local cd /var/mugsyOS/frontend/dev/mugsyFront/ npm start
-
Run the Redis queue worker with a scheduler:
rq worker --with-scheduler
Note: Remember to replace "******************************" with your actual MongoDB password, and "mugsySolo.local" with your actual server host. This walkthrough assumes you have sudo permissions and all paths and repository URLs are provided as examples.