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

# Create the GeoNode Virtual Environment (first time only)
export WORKON_HOME=~/.virtualenvs
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
mkvirtualenv --python=/usr/bin/python3.10 geonode42  # Use the python path from above

# Alterantively you can also create the virtual env like below
mkdir -p ~/.virtualenvs
python3.10 -m venv ~/.virtualenvs/geonode42
source ~/.virtualenvs/geonode42/bin/activate

At this point your command prompt shows a (geonode42) 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 geonode42

# Alterantively you can also create the virtual env like below
source ~/.virtualenvs/geonode42/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/geonode42/; sudo usermod -a -G www-data $USER; sudo chown -Rf $USER:www-data /opt/geonode42/; sudo chmod -Rf 775 /opt/geonode42/

# Clone the GeoNode source code on /opt/geonode
cd /opt; git clone https://github.com/GeoNode/geonode.git -b 4.2.x geonode42
# Install the Python packages
cd /opt/geonode42
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=geonode42
  GEONODE_GEODATABASE=geonode_data --> GEONODE_GEODATABASE=geonode42_data
  DATABASE_URL=...alhost:5432/geonode --> DATABASE_URL=...alhost:5432/geonode42
  GEODATABASE_URL=...alhost:5432/geonode_data --> GEODATABASE_URL=...alhost:5432/geonode42_data
# Run the migration scripts
./paver_local.sh sync