### Starting Memos Frontend Development Server - Bash Source: https://github.com/usememos/dotcom/blob/main/content/docs/contribution/development.md This sequence of commands navigates into the 'web' directory, installs necessary frontend dependencies using pnpm, and then starts the frontend development server. This makes the Memos web interface accessible, typically at http://localhost:3001. ```bash cd web && pnpm i && pnpm dev ``` -------------------------------- ### Starting the Development Server (npm) Source: https://github.com/usememos/dotcom/blob/main/content/docs/contribution/documentation.md This command starts the local development server for the documentation website, typically accessible at `http://localhost:3000`. It enables live reloading, reflecting code changes instantly. ```bash npm run dev ``` -------------------------------- ### Installing Project Dependencies (npm) Source: https://github.com/usememos/dotcom/blob/main/content/docs/contribution/documentation.md This command installs all necessary Node.js dependencies for the documentation project, as defined in the `package.json` file. It's a prerequisite for running the development server. ```bash npm install ``` -------------------------------- ### Building and Running Memos Backend - Bash Source: https://github.com/usememos/dotcom/blob/main/content/docs/contribution/development.md This command executes the build script for the Memos backend. It compiles the Go application, preparing the server for execution. After a successful build, the output will guide you on how to run the server. ```bash sh scripts/build.sh ``` -------------------------------- ### Running Memos with Default Docker Volume (Shell) Source: https://github.com/usememos/dotcom/blob/main/content/blog/syncing-data-with-icloud.md This command demonstrates the standard Docker setup for running Memos, mapping the default ~/.memos directory on the host to /var/opt/memos inside the container. It exposes Memos on port 5230 and runs it in detached mode. This is the recommended initial setup for Memos. ```shell docker run -d --name memos -p 5230:5230 -v ~/.memos/:/var/opt/memos neosmemo/memos:stable ``` -------------------------------- ### Starting Memogram Binary Source: https://github.com/usememos/dotcom/blob/main/content/docs/integration/telegram-bot.md This command executes the Memogram binary from the terminal. It assumes the binary is in the current directory and a .env file with necessary configurations is present alongside it. Running this command initiates the Telegram bot integration service. ```Shell ./memogram ``` -------------------------------- ### Creating Task Lists in Markdown Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md This snippet shows how to create task lists (checklists) in Markdown using dashes and square brackets. It includes examples of both unchecked (`[ ]`) and checked (`[x]`) items, and demonstrates nested tasks. ```markdown - [x] Item 1 - [ ] Item 2 - [ ] Item 2.1 - [x] Item 2.2 ``` -------------------------------- ### Calling Memos API with Access Token - cURL Example Source: https://github.com/usememos/dotcom/blob/main/content/docs/security/access-tokens.md This example demonstrates how to make an authenticated GET request to the Memos API using the 'curl' command-line tool. It shows how to include both the 'Accept' and 'Authorization' headers, with the latter containing the 'Bearer' token for authentication. ```shell curl https://demo.usememos.com/api/v1/memos \ -H "Accept: application/json" \ -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" ``` -------------------------------- ### Placing Tags at Content Start - Markdown Source: https://github.com/usememos/dotcom/blob/main/content/blog/best-practices-to-write-tag.md This snippet demonstrates the recommended practice of placing tags at the very beginning of the content. This ensures that the Memos regex parser can easily identify and process the tags without interference from other content, improving recognition accuracy. ```markdown #Mark #Website The place for anyone from anywhere to build anything Whether you’re scaling your startup or just learning how to code, GitHub is your home. Join the world’s largest developer platform to build the innovations that empower humanity. Let’s build from here. ``` -------------------------------- ### Getting Memos Container Shell (Bash) Source: https://github.com/usememos/dotcom/blob/main/content/docs/troubleshooting/index.md This command provides an interactive shell (ash) inside the 'memos' Docker container. It is a prerequisite for executing further commands directly within the container's environment, such as installing utilities or interacting with the database. ```bash docker exec -it memos ash ``` -------------------------------- ### Deploying Memos with Docker Run (Bash) Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/container-install.md This command deploys Memos as a Docker container in detached mode. It initializes the container, names it 'memos', maps host port 5230 to container port 5230, and mounts the host's `~/.memos/` directory to `/var/opt/memos` inside the container for data persistence. This ensures Memos runs in the background and its data is stored on the host. ```bash docker run -d \ --init \ --name memos \ --publish 5230:5230 \ --volume ~/.memos/:/var/opt/memos \ neosmemo/memos:stable ``` -------------------------------- ### Running Memos with MySQL using Docker Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/database.md This command starts Memos as a Docker container, configuring it to use MySQL as the database driver. It maps port 5230, mounts a volume for data persistence, and specifies the MySQL connection details via --driver and --dsn arguments. ```shell docker run -d --name memos -p 5230:5230 -v ~/.memos/:/var/opt/memos neosmemo/memos:stable --driver mysql --dsn 'root:password@tcp(localhost)/memos_prod' ``` -------------------------------- ### Installing SQLite Shell in Memos Container (Bash) Source: https://github.com/usememos/dotcom/blob/main/content/docs/troubleshooting/index.md This command installs the SQLite shell utility within the Memos Docker container using the 'apk' package manager. This tool is essential for directly querying and modifying the Memos application's SQLite database file. ```bash apk add --no-cache sqlite ``` -------------------------------- ### Docker Compose Configuration for Memos with PostgreSQL Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/database.md This docker-compose.yml file defines a multi-service setup for Memos and a PostgreSQL database. It configures Memos to depend on the 'db' service, sets environment variables for PostgreSQL connection, and defines the PostgreSQL service with data persistence and credentials. ```yaml version: "3.0" services: memos: image: neosmemo/memos:stable restart: always depends_on: - db ports: - 5230:5230 environment: - MEMOS_DRIVER=postgres - MEMOS_DSN=user=memos password=secret dbname=memosdb host=db sslmode=disable db: image: postgres:16.1 restart: unless-stopped volumes: - "./database:/var/lib/postgresql/data/" environment: POSTGRES_USER: memos POSTGRES_PASSWORD: secret POSTGRES_DB: memosdb ``` -------------------------------- ### Running Memos with PostgreSQL using Docker Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/database.md This command starts Memos as a Docker container, configuring it to use PostgreSQL as the database driver. It maps port 5230, mounts a volume for data persistence, and specifies the PostgreSQL connection details via --driver and --dsn arguments. ```shell docker run -d --name memos -p 5230:5230 -v ~/.memos/:/var/opt/memos neosmemo/memos:stable --driver postgres --dsn 'postgresql://postgres:PASSWORD@localhost:5432/memos' ``` -------------------------------- ### Creating Ordered Lists in Markdown Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md This snippet illustrates how to create ordered (numbered) lists in Markdown. Numbers are followed by periods, and nesting is supported, with the list automatically starting from 1 regardless of the initial number used. ```markdown 1. Item 1 2. Item 2 1. Item 2.1 2. Item 2.2 ``` -------------------------------- ### Embedding Mermaid Diagrams in Memos Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md This snippet demonstrates how to embed Mermaid diagrams in Memos by using 'mermaid' as the language for a code block. It shows an example of a simple flowchart definition. ```mermaid graph TD; A-->B; A-->C; B-->D; C-->D; ``` -------------------------------- ### Configuring Memos with Docker Compose (YAML) Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/container-install.md This YAML configuration defines a Docker Compose service for Memos. It specifies the `neosmemo/memos:stable` image, names the container 'memos', mounts the host's `~/.memos/` directory for data persistence, and maps host port 5230 to container port 5230. This file is used with `docker compose up -d` to deploy Memos. ```yaml services: memos: image: neosmemo/memos:stable container_name: memos volumes: - ~/.memos/:/var/opt/memos ports: - 5230:5230 ``` -------------------------------- ### Deploying Memos with Docker Run on PowerShell Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/container-install.md This PowerShell command deploys Memos as a Docker container in detached mode, similar to the bash version but adapted for Windows. It initializes the container, names it 'memos', maps host port 5230 to container port 5230, and mounts the host's `$Env:USERPROFILE\memos` directory to `/var/opt/memos` inside the container for data persistence. This allows Memos to run in the background on Windows. ```powershell docker run -d ` --init ` --name memos ` --publish 5230:5230 ` --volume $Env:USERPROFILE\memos:/var/opt/memos ` neosmemo/memos:stable ``` -------------------------------- ### Docker Compose Configuration for Memos with Caddy Source: https://github.com/usememos/dotcom/blob/main/content/docs/install/https.md This `docker-compose.yml` file defines a multi-service setup for Memos and Caddy. Memos runs on port 5230, exposed only internally. Caddy acts as a reverse proxy, publicly accessible on ports 80 and 443, handling TLS, logging, and compression for Memos. It mounts volumes for persistent data and configuration. ```YAML services: memos: image: neosmemo/memos:stable container_name: memos restart: unless-stopped expose: [5230/tcp] volumes: - ~/.memos:/var/opt/memos caddy: image: caddy:2.8 container_name: caddy restart: unless-stopped ports: - 0.0.0.0:80:80/tcp - 0.0.0.0:443:443 configs: - source: Caddyfile target: /etc/caddy/Caddyfile volumes: - ~/.caddy/data:/data - ~/.caddy/config:/config - ~/.caddy/logs:/logs configs: Caddyfile: content: | memos.your-domain.com, memos.your-domain.net { reverse_proxy memos:5230 log { format console output file /logs/memos.log { roll_size 10mb roll_keep 20 roll_keep_for 7d } } encode { zstd gzip minimum_length 1024 } } ``` -------------------------------- ### Rendering Custom HTML in Memos Source: https://github.com/usememos/dotcom/blob/main/content/docs/getting-started/content-syntax.md This snippet illustrates how to render custom HTML content directly within Memos by specifying '__html' as the language for a code block. It provides an example of rendering a horizontal divider. ```__html
``` -------------------------------- ### Re-enabling Password Login in Memos (Bash/SQLite) Source: https://github.com/usememos/dotcom/blob/main/content/docs/troubleshooting/index.md This command executes an SQLite update on the Memos database to re-enable password-based login. It modifies the 'GENERAL' system setting by patching its JSON 'value' to set 'disallowPasswordLogin' to 'false', resolving lockout issues caused by failed SSO setups. ```bash sqlite3 /var/opt/memos/memos_prod.db -cmd '.mode csv' <