Support #966
Updated by Daniel Curtis almost 3 years ago
This is a guide for installing Mealie on Debian. Using the officially supported Docker image will likely be easier, this is just fun. h2. Prepare the Environment * Make sure the system is up to date: <pre> apt update && apt upgrade </pre> * Install some prerequisites: <pre> apt install nodejs npm python3 python3-dev python3-venv python3-pip python3-cryptography git curl build-essential libpq-dev libwebp-dev libsasl2-dev libldap2-dev libssl-dev gnupg gnupg2 gnupg1 debian-keyring debian-archive-keyring apt-transport-https libbluetooth-dev libbz2-dev libc6-dev libexpat1-dev libffi-dev libgdbm-dev liblzma-dev libncursesw5-dev libreadline-dev libsqlite3-dev libssl-dev libxslt1-dev libxml2-dev libjpeg-dev make tk-dev uuid-dev wget xz-utils zlib1g-dev rustc </pre> * Create a user for mealie: <pre> useradd -u 911 -U -d /app -s /bin/bash abc mealie mkdir /app /home/mealie mkdir /opt/poetry mkdir /opt/pysetup chown abc:abc /app mealie:mealie /home/mealie/ chown abc:abc /opt/pysetup chown abc:abc /opt/poetry su - abc mealie </pre> * Set a few environment variables: <pre> echo 'export PYTHONUNBUFFERED=1 ' >> ~/.bashrc echo 'export PYTHONDONTWRITEBYTECODE=1' >> ~/.bashrc echo 'export PIP_NO_CACHE_DIR=off' >> ~/.bashrc echo 'export PIP_DISABLE_PIP_VERSION_CHECK=on' >> ~/.bashrc echo 'export PIP_DEFAULT_TIMEOUT=100' >> ~/.bashrc echo 'export POETRY_HOME="/opt/poetry"' POETRY_HOME="/home/mealie/poetry"' >> ~/.bashrc echo 'export POETRY_VIRTUALENVS_IN_PROJECT=true' >> ~/.bashrc echo 'export POETRY_NO_INTERACTION=1' >> ~/.bashrc echo 'export PYSETUP_PATH="/opt/pysetup"' PYSETUP_PATH="/home/mealie/pysetup"' >> ~/.bashrc echo 'export VENV_PATH="/opt/pysetup/.venv"' VENV_PATH="/home/mealie/poetry/venv"' >> ~/.bashrc source ~/.bashrc </pre> * Install python poetry: <pre> cd $PYSETUP_PATH mkdir ~/poetry curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python3 - </pre> * Add local bin execution path: <pre> echo 'export PATH="/opt/poetry/bin:/opt/pysetup/.venv/bin:$PATH"' PATH="/home/mealie/poetry/bin:/home/mealie/poetry/venv:$PATH"' >> ~/.bashrc source ~/.bashrc </pre> h2. Install Mealie * Download mealie: <pre> mkdir -p /app/git ~/git && cd /app/git ~/git git clone https://github.com/hay-kot/mealie.git </pre> h3. Frontend * Setup the frontend directory: <pre> /app mkdir ~/frontend && cd ~/frontend cp git/mealie/frontend/package*.json ~/git/mealie/frontend/package*.json . npm install cp -r git/mealie/frontend/* ~/git/mealie/frontend/* . npm run build </pre> h3. Backend * Create and prep a temporary build directory: <pre> mkdir ~/pysetup && cd $PYSETUP_PATH ~/pysetup cp /app/git/mealie/poetry.lock ~/git/mealie/poetry.lock . cp /app/git/mealie/pyproject.toml ~/git/mealie/pyproject.toml . </pre> * Build mealie venv: <pre> poetry install -E pgsql --no-dev </pre> * Build mealie backend: <pre> cd /app ~/git/mealie cp -r git/mealie . cp mealie/poetry.lock . cp mealie/pyproject.toml . sh /opt/pysetup/.venv/bin/activate poetry/venv/bin/activate poetry install </pre> * Initialize the database: <pre> poetry run python /app/mealie/db/init_db.py poetry run python /app/mealie/services/image/minify.py </pre> h2. Resources * https://github.com/hay-kot/mealie * https://hay-kot.github.io/mealie/contributors/developers-guide/starting-dev-server/ * https://hay-kot.github.io/mealie/documentation/getting-started/install/