STOP! Have you done a first-time deployment or an upgrade of the Brain Annex web app? If so,
you are in the right place, ready to start the web app.
IMPORTANT: make sure that the Neo4j server is running! (see Install the Neo4j Database)

For Windows, here we'll only cover installations employing the built-in WSGI HTTP server that comes with Flask ("Werkzeug").
Typically, LOCAL installations NOT meant for production :
DEPLOYMENT = FLASK
http://localhost:5000

| $ cd /home/brain_annex | CHANGE the directory name, if you used a different one |
| $ source venv/bin/activate | To start the virtual environment |
neo4j://localhost when prompted about the host; then it will prompt for the dbase password.
If all goes well, it will show some diagnostic info)
| $ cd /home/brain_annex | CHANGE the directory name, if you used a different one |
| (venv) $ source venv/bin/activate | To start the virtual environment |
| (venv) $ cat config.ini | grep DEPLOYMENT |
to make sure that you have DEPLOYMENT = FLASK in your Brain Annex config.ini file |
| (venv) $ export FLASK_APP=main.py | to inform Flask on how to start |
| (venv) $ flask run --host=0.0.0.0 --port 5000 &> flask_log.txt & | to redirect both stdout and stderr; change port if desired - but be aware that 80 won't work |
| (venv) $ ps -e | grep flask | to double-check there's a 'flask' process running in the background |
| (venv) $ deactivate | leave the venv |
| $ cat flask_log.txt | optional, to check the log |
http://YOUR_SERVER_IP_ADDRESS:5000$ sudo lsof -i:5000 (to investigate the network)$ netstat -an | grep 5000 (to further investigate the network)| $ sudo su - | to elevate permissions to the root account; notice the changed prompt in the next line |
| root # cd /home/brain_annex | or whichever home location is being used |
| root # cat config.ini | grep DEPLOYMENT | make sure it says: DEPLOYMENT = EXTERNAL |
| root # source venv/bin/activate | this will enter the virtual environment; notice the changed prompt in the next line |
| (venv) root # ls venv/lib | make a note of the version of python; MAKE SURE it's 3.10+ |
| (venv) root # export PYTHONPATH=$PYTHONPATH:`pwd`/venv/lib/python3.10/site-packages | OR whichever version was shown in the previous step; it MUST be 3.10+ |
gunicorn -w 1 -b 0.0.0.0:80 main:app &gunicorn --worker-class gthread --threads 3 -w 1 -b 0.0.0.0:80 main:app > brainannex_log.txt &http://YOUR_SERVER_IP_ADDRESS
gunicorn --certfile=/etc/letsencrypt/live/YOUR_DOMAIN/fullchain.pem --keyfile=/etc/letsencrypt/live/YOUR_DOMAIN/privkey.pem
--error-logfile gunicorn_log.txt -b 0.0.0.0:443 main:app > brainannex_log.txt & gunicorn -w 5 --certfile=/etc/letsencrypt/live/YOUR_DOMAIN/fullchain.pem --keyfile=/etc/letsencrypt/live/YOUR_DOMAIN/privkey.pem
--error-logfile gunicorn_log.txt -b 0.0.0.0:443 main:app > brainannex_log.txt &
lscpu)
ps -e | grep gunicorn , you should see (1 + number of workers) gunicorn processes (running in the background.) For example, in the case
of the "minimalist" gunicorn invocation, there should be 2 processes.https://YOUR_DOMAINbrainannex_log.txt (contents get buffered; so, they may not be immediately visible)gunicorn_log.txt
gunicorn -w 7
--error-logfile gunicorn_log.txt -b 0.0.0.0:8000 main:app > brainannex_log.txt &
lscpu)
sudo caddy startps -e | grep gunicorn , and you should see (1 + number of workers) gunicorn processes (running in the background.)curl localhost:2019/config/ | jqhttps://YOUR_DOMAINbrainannex_log.txt (contents get buffered; so, they may not be immediately visible)gunicorn_log.txt
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
(More info).
If you followed the directions in the previous sections,
when you set your browser to the URL specified in the instructions in that section for your specific installation scenario,
you should see a simple web pages with a message and a few links.
Depending on the deployment you used, the URL could be:
https://YOUR_DOMAIN
http://YOUR_SERVER_IP_ADDRESS
http://localhost:5000
If this is your initial install of the web app, you must create a first user login account (the
first account creation will also add the "Schema" data necessary for User management.)
You may also re-run the same script, below, at any later time to create additional login accounts:
(you may skip these first 2 steps, if you never deactivated the virtual environment from earlier)
Use .\venv\Scripts\Activate.ps1 (assuming you are already
in the right folder, as stated above; there should be a "venv" subfolder.)
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSignedpython initialize_installation.py
Go the the login page from the earlier section.
(The specific URL will depend on your installation specifics.)
Log in using any of the accounts that you created in the previous section
Congratulations, now you can start using the various control panels offered by the Brain Annex web app.
If you also ran the optional earlier step "Create Database Schema", you will in addition have access to the
multimedia content-management capability of Brain Annex.
If, at a later date, you upgrade the software, refer to the page for Routine Upgrades.