-
Notifications
You must be signed in to change notification settings - Fork 18
Data Portal installation on Ubuntu 18.04
Tested with CKAN 2.8.3 on Ubuntu 18.04.3
- Install Python 2.7
sudo apt-get install python-dev python-pip
- Install
virtualenv
to manage your Python environments
sudo apt-get install python-virtualenv
- install Git
sudo apt-get install git-core
- Set your name (replace
Your Name
with your first and last name, e.g.,Reuben Cummings
)
git config --global user.name "Your Name"
- Set your commit email address (replace
[email protected]
with your email address, e.g.,[email protected]
).
Note: This should be the same email address you used to signup for your GitHub account
git config --global user.email "[email protected]"
- Check that both configurations have been set correctly
git config --global --list
- install
sudo apt-get install postgresql libpq-dev
- install libmagic
sudo apt-get install libmagic-dev
- In the top-right corner of the repo page, click Fork.
-
On GitHub, navigate to your fork of the data-portal repository, e.g.,
https://github.com/yourusername/data-portal
-
Under the repository name, click Clone or download
- In the Clone with HTTPs section, click the clipboard icon to copy the clone URL for the repository.
- Create a directory to hold the cloned project
mkdir -p ~/Documents/Projects
cd ~/Documents/Projects
-
Type
git clone
, and then paste the URL you copied in step 3 above. It will look likegit clone https://github.com/YOUR-USERNAME/data-portal
, but with your GitHub username instead ofYOUR-USERNAME
-
Press Enter. Your local clone will be created.
- Create and activate a virtual environment
cd data-portal
virtualenv --no-site-packages --python=python2.7 venv
source venv/bin/activate
- Install required Python libraries
pip install -r requirements.txt -r dev-requirements.txt
- start the server
sudo -u postgres pg_ctl -D /usr/local/var/postgres start
- Create a PostgreSQL user
sudo -u postgres createuser -U postgres ckan_default
- Create a PostgreSQL database
sudo -u postgres createdb -U postgres -O ckan_default ckan_default -E utf-8
- Open the
development.ini
file and edit line 47
sqlalchemy.url = postgresql://ckan_default:password@localhost/ckan_default
to replace password
with the password you chose in step 3 above.
open development.ini
- Create database tables
paster --plugin=ckan db init -c development.ini
You should see Initialising DB: SUCCESS
- Start ckan
paster --plugin=ckan serve development.ini
You should see serving on http://127.0.0.1:5000
- Open http://127.0.0.1:5000, and you should see the CKAN front page.
Reference: