1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GhostをDockerでローカル構築!最短で管理画面にアクセスするまで

Last updated at Posted at 2025-07-16

最近、開発をしてないために、自作のブログを作って、Markdownで記事を展開するCMSを構築したいと考えています。
色々なプラットフォームがあってもどうやらnoteのように簡易に記事を作れるとうプラットフォームはなかなかないというか、ありませんでした。(2025年7月16日時点)
しかし、私は、Ghostという海外では注目されているセルフホスト型のツールをまずはローカルに入れてみたいと思い開発環境を構築することとしました。

導入は手軽なので、そのまま書きます。

使用環境

  • Docker v24.x
  • Ghost v5.x(latest)
  • Windows/macOS/Linux 対応

起動コマンド一発

docker run -d --name ghost-local -p 2368:2368 -e url=http://localhost:2368 ghost:latest

docker-compose.ymlを使って将来拡張したい方へ

docker-compseo.yml
services:
  ghost:
    image: ghost:latest
    depends_on:
      - mysql
    environment:
      database__client: mysql
      database__connection__host: mysql
      database__connection__user: ghost
      database__connection__password: ghostpass
      database__connection__database: ghostdb
    ports:
      - "2368:2368"
    volumes:
      - ./content:/var/lib/ghost/content

  mysql:
    image: mysql:8.0
    environment:
      MYSQL_ROOT_PASSWORD: rootpass
      MYSQL_DATABASE: ghostdb
      MYSQL_USER: ghost
      MYSQL_PASSWORD: ghostpass
    volumes:
      - ./mysql:/var/lib/mysql

この後にhttp://localhost:2368/ghostに、ブラウザアクセスすれば作成画面にいけます。

image.png

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?