How to Install wger on OpenBSD
wger is a free, open-source web application to manage your personal fitness, nutrition, and health data.
If you want to use wger on your OpenBSD system, you can follow these steps:
Requirements
- OpenBSD system
- root access or sudo privileges
- Internet connection
Installation
Open the terminal on your OpenBSD system.
Update the system's package manager:
$ doas pkg_add -uInstall the required packages:
$ doas pkg_add -i gmake py3-pip postgresql-server postgresql-contribAdd PostgreSQL to the system's rc.conf file:
$ doas rcctl enable postgresql $ doas rcctl start postgresqlCreate a PostgreSQL user and database for wger:
$ doas su - postgres $ psql postgres=# CREATE USER wger WITH PASSWORD 'password'; postgres=# CREATE DATABASE wger OWNER wger; postgres=# \qInstall wger using pip:
$ doas pip-3.8 install wgerRun the database migrations:
$ doas su - _wger $ wger migrate $ exit
Configuration
Create a configuration file named
wger.iniin the_wgeruser's home directory:$ doas su - _wger $ cp /usr/local/lib/python3.8/site-packages/wger/wsgi.ini wger.ini $ exitEdit the configuration file using your preferred text editor:
$ doas nano /home/_wger/wger.iniChange the following lines in the configuration file:
[server:main] use = egg:waitress#main host = 0.0.0.0 # Change to '127.0.0.1' if running locally only port = 8000 [app:main] sqlalchemy.url = postgresql://wger:password@localhost:5432/wgerSave and exit the configuration file.
Running wger
Start the wger server:
$ doas su - _wger $ wger serve --reloadOpen a web browser and go to
http://localhost:8000/(or the IP address of your server) to access the wger application.
Congratulations! You have successfully installed and configured wger on your OpenBSD system.