GeoNode Basic Install

This is the most basic installation of GeoNode. It won’t use an external server like Apache Tomcat, PostgreSQL or HTTPD.

First of all, we need to prepare a new Python Virtual Environment

Since GeoNode needs a large number of different python libraries and packages, it’s recommended to use a python virtual environment to avoid conflicts on dependencies with system-wide python packages and other installed software. Also, every time see the documentation on the Virtualenvwrapper package for more information

Note

The GeoNode Virtual Environment must only be created the first time. You won’t need to create it again every time.

which python3.10  # copy the path of the python executable

mkdir -p ~/.virtualenvs
python3.10 -m venv ~/.virtualenvs/geonode4
source ~/.virtualenvs/geonode4/bin/activate

At this point your command prompt shows a (geonode4) prefix, this indicates that your virtualenv is active.

Note

The next time you need to access the Virtual Environment just run:

source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
workon geonode4

# Alterantively you can also create the virtual env like below
source ~/.virtualenvs/geonode4/bin/activate

Note

In order to save permanently the virtualenvwrapper environment run:

vim ~/.bashrc

# Write the following lines at the bottom of the file
export WORKON_HOME=~/.virtualenvs
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
# Let's create the GeoNode core base folder and clone it
sudo mkdir -p /opt/geonode4/; sudo usermod -a -G www-data $USER; sudo chown -Rf $USER:www-data /opt/geonode4/; sudo chmod -Rf 775 /opt/geonode4/

# Clone the GeoNode source code on /opt/geonode
cd /opt; git clone https://github.com/GeoNode/geonode.git -b 4.4.x geonode4
# Install the Python packages
cd /opt/geonode4
pip install -r requirements.txt
pip install -e . --upgrade
pip install pygdal=="`gdal-config --version`.*"

Initialize GeoNode

# Initialize GeoNode
sudo chmod +x *.sh
sudo chmod -Rf 777 geonode/static_root/ geonode/uploaded/

Update the Database references

# Edit the GeoNode environment variables
vim .env_local

  GEONODE_DATABASE=geonode --> GEONODE_DATABASE=geonode4
  GEONODE_GEODATABASE=geonode_data --> GEONODE_GEODATABASE=geonode4_data
  DATABASE_URL=...alhost:5432/geonode --> DATABASE_URL=...alhost:5432/geonode4
  GEODATABASE_URL=...alhost:5432/geonode_data --> GEODATABASE_URL=...alhost:5432/geonode4_data
# Run the migration scripts
./paver_local.sh sync