Setup Memos Note-Taking App with MySQL on Docker & S3 Storage

on

|

views

and

comments

By Anurag Vishwakarma
in
Cloud

Mar 23, 2024

Self-host the open-source, privacy-focused note-taking app Memos using Docker with a MySQL database and integrate with S3 or Cloudflare R2 object storage.

Image is subject to copyright!

What is Memos?Memos is an open-source, privacy-first, and lightweight note-taking application service that allows you to easily capture and share your thoughts. Memos features:Open-source and free foreverSelf-hosting with Docker in secondsPure text with Markdown supportCustomize and share notes effortlesslyRESTful API for third-party integrationSelf-Hosting Memos with Docker and MySQL DatabaseYou can self-host Memos quickly using Docker Compose with a MySQL database. Prerequisites: Docker and Docker Compose installedYou have two options to choose MySQL or MariaDB as a Database both are stable versions and MariaDB consumes less memory than MySQL.Memos with MySQL 8.0version: “3.0”

services:

mysql:
image: mysql:8.0
environment:
TZ: Asia/Kolkata
MYSQL_ROOT_PASSWORD: memos
MYSQL_DATABASE: memos-db
MYSQL_USER: memos
MYSQL_PASSWORD: memos
volumes:
– mysql_data:/var/lib/mysql

memos:
image: neosmemo/memos:stable
container_name: memos
environment:
MEMOS_DRIVER: mysql
MEMOS_DSN: memos:memos@tcp(mysql:3306)/memos-db
depends_on:
– mysql
volumes:
– ~/.memos/:/var/opt/memos
ports:
– “5230:5230”

volumes:
mysql_data:
Memos with MySQL Database Docker ComposeORMemos with MariaDB 11.0version: “3.0”
services:
mariadb:
image: mariadb:11.0
environment:
TZ: Asia/Kolkata
MYSQL_ROOT_PASSWORD: memos
MYSQL_DATABASE: memos-db
MYSQL_USER: memos
MYSQL_PASSWORD: memos
volumes:
– mariadb_data:/var/lib/mysql

memos:
image: neosmemo/memos:stable
container_name: memos
environment:
MEMOS_DRIVER: mysql
MEMOS_DSN: memos:memos@tcp(mariadb:3306)/memos-db
depends_on:
– mariadb
volumes:
– ~/.memos/:/var/opt/memos
ports:
– “5230:5230”

volumes:
mariadb_data:
Memos with MariaDB Database Docker ComposeCreate a new file named docker-compose.yml and copy the above content.This sets up a MariaDB 11.0 database service and the Memos app linked to it.Run docker-compose up -d to start the services in detached mode.Memos will be available at http://localhost:5230.The configurations are:mysql service runs MySQL 8.0 with a database named memos-db.memos service runs the latest Memos images, and links to the mysql/mariadb service.MEMOS_DRIVER=mysql tells Memos to use the MySQL database driver.MEMOS_DSN contains the database connection details.The ~/.memos the directory is mounted for data persistence.You can customize the MySQL password, database name, and other settings by updating the environment variables.Kubernetes for NoobsKubernetes is an open-source system that helps with deploying, scaling, and managing containerized applications.Configuring S3 Compatible StorageMemos support integrating with S3-compatible object storage like Amazon S3, Cloudflare R2, DigitalOcean Spaces, etcTo use AWS S3/ Cloudflare’s R2 as object storageSettings > StorageCreate a S3/Cloudflare R2 bucketGet the API token with object read/write permissionsIn Memos Admin Settings > Storage, create a new storageEnter details like Name, Endpoint, Region, Access Key, Secret Key, Bucket name and Public URL (For Cloudflare R2 set Region = auto)Save and select this storageFor Cloudflare R2 set Region = autoWith this setup, you can self-host the privacy-focused Memos note app using Docker Compose with a MySQL database, while integrating scalable S3 or R2 storage for persisting data.13 Tips to Reduce Energy Costs on Your HomeLab ServerHomeLabs can be expensive when it comes to energy costs. It’s easy to accumulate multiple power-hungry servers, networking equipment, and computers.How to Run Linux Docker Containers Natively on Mac with OrbStack?Run Linux-based Docker containers natively on macOS with OrbStack’s lightning-fast performance, featherlight resource usage, and simplicity. Get the best Docker experience on Mac.

Share this
Tags

Must-read

Mortgage Rates Could Fall Another Half Point Just from Market Normalization

It’s been a pretty good year so far for mortgage rates, which topped out at around 8% last year.The 30-year fixed is now priced...

Goldman Sachs loses profit after hits from GreenSky, real estate

Second-quarter profit fell 58% to $1.22 billion, or $3.08 a share, due to steep declines in trading and investment banking and losses related to...

Half of Japan’s chip-making equipment exports headed to China in Q1 · TechNode

Japan’s Ministry of Finance trade statistics show that half of Japan’s semiconductor manufacturing equipment exports were heading to China in the first quarter, according...
spot_img

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here