This project is still young and isn't, at the moment, very stable, so please proceed with caution when running in production.
This method of installation is more involved, and therefore is for more experienced admins. Docker install is the recommended method as there may not be much support available for Dockerless installation. If you have expertise in this area, we would love your help to improve this documentation!
This install method assumes you already have ssl configured with certificates available.
apt install postgresql redis nginx python3-venv python3-pip python3-dev libpq-dev gunicorn
The production
branch of BookWyrm contains a number of tools not on the main
branch that are suited for running in production, such as docker-compose
changes to update the default commands or configuration of containers, and individual changes to container config to enable things like SSL or regular backups. Not all of these changes effect the dockerless install, however the production
branch is still recommended
Instructions for running BookWyrm in production without Docker:
/opt/bookwyrm
:
mkdir /opt/bookwyrm && cd /opt/bookwyrm
production
branch:
git clone https://github.com/bookwyrm-social/bookwyrm.git --branch production --single-branch ./
cp .env.example .env
, and update the following. Passwords should generally be enclosed in "quotation marks":SECRET_KEY
| A difficult to guess, secret string of characters.DOMAIN
| Your web domainPOSTGRES_PASSWORD
| Set a secure password for the databasePOSTGRES_HOST
| Set to localhost
(the machine running your db)POSTGRES_USER
| Set to bookwyrm
(recommended) or something custom (configured later)POSTGRES_DB
| Set to bookwyrm
REDIS_ACTIVITY_PASSWORD
| Set to nothing (fine on a local machine with a firewall)REDIS_ACTIVITY_HOST
| Set to localhost
(the machine running redis)REDIS_BROKER_PASSWORD
| Set to nothing (fine on a local machine with a firewall)REDIS_BROKER_HOST
| Set to localhost
(the machine running redis)EMAIL_HOST_USER
| The "from" address that your app will use when sending emailEMAIL_HOST_PASSWORD
| The password provided by your email service/var/cache/nginx
directory:mkdir /var/cache/nginx
chown www-data:www-data /var/cache/nginx
cp nginx/server_config /etc/nginx/conf.d/server_config
cp nginx/production /etc/nginx/sites-available/bookwyrm.conf
bookwyrm.conf
:your-domain.com
with your domain name everywhere in the file (including the lines that are currently commented out)/app
with your install directory /opt/bookwyrm
everywhere in the file (including commented out)server
blocks enabledssl_certificate
and ssl_certificate_key
paths to your fullchain and privkey locationsserver localhost:8000
. You may choose a different port here if you wishln -s /etc/nginx/sites-available/bookwyrm.conf /etc/nginx/sites-enabled/bookwyrm.conf
systemctl reload nginx
python3 -m venv ./venv
./venv/bin/pip3 install -r requirements.txt
.env
config:
sudo -i -u postgres psql
CREATE USER bookwyrm WITH PASSWORD 'securedbypassword123';
CREATE DATABASE bookwyrm TEMPLATE template0 ENCODING 'UNICODE';
ALTER DATABASE bookwyrm OWNER TO bookwyrm;
GRANT ALL PRIVILEGES ON DATABASE bookwyrm TO bookwyrm;
\q
venv/bin/python3 manage.py migrate
venv/bin/python3 manage.py initdb
venv/bin/python3 manage.py compile_themes
venv/bin/python3 manage.py collectstatic --no-input
bookwyrm
useruseradd bookwyrm -r
chown -R bookwyrm:bookwyrm /opt/bookwyrm
sudo -u bookwyrm echo I am the $(whoami) user
Configure, enable, and start BookWyrm's systemd
services:
cp contrib/systemd/*.service /etc/systemd/system/
systemctl enable bookwyrm bookwyrm-worker bookwyrm-scheduler
Generate the admin code with sudo -u bookwyrm venv/bin/python3 manage.py admin_code
, and copy the admin code to use when you create your admin account.
*******************************************
Use this code to create your admin account:
c6c35779-af3a-4091-b330-c026610920d6
*******************************************
Congrats! You did it!! Configure your instance however you'd like.
Like all software, BookWyrm can contain bugs, and often these bugs are in the Python code and easiest to reproduce by getting more context from the logs.
If you use the provided systemd
service configurations from contrib/systemd
you will be able to read the logs with journalctl
:
# viewing logs of the web process
journalctl -u bookwyrm
# viewing logs of the worker process
journalctl -u bookwyrm-worker
# viewing logs of the scheduler process
journalctl -u bookwyrm-scheduler
Feel free to explore additional ways of slicing and dicing logs with flags documented in journalctl --help
.
While BookWyrm's application logs will most often be enough, you can find logs for other services like Nginx,
PostgreSQL, or Redis are usually in .log
files located somewhere in /var/logs
.
See Get Involved for details.