localhost:4000
Two frameworks share port 4000, and they couldn't be more different. Jekyll is a Ruby-based static site generator — the engine behind GitHub Pages. Phoenix is an Elixir web framework built for real-time applications and extreme concurrency. If you're seeing 4000, it's almost certainly one of these two.
Jekyll — Static Sites and GitHub Pages
Jekyll takes Markdown files, runs them through templates, and generates a static HTML website. It's what GitHub Pages uses under the hood, which means millions of developer blogs, documentation sites, and project pages are built with Jekyll.
# Install Jekyll
gem install bundler jekyll
# Create a new site
jekyll new my-blog
cd my-blog
# Run the dev server
bundle exec jekyll serve
# => Server running at http://localhost:4000
# With live reload (auto-refreshes browser on save)
bundle exec jekyll serve --livereload
# Draft posts included
bundle exec jekyll serve --drafts
The dev server watches your files and regenerates the site when you save changes. The generated HTML goes into a _site folder — that's what gets deployed.
Jekyll Project Structure
my-blog/
├── _posts/ # Blog posts (2024-01-15-my-post.md)
├── _layouts/ # HTML templates
├── _includes/ # Reusable HTML snippets
├── _config.yml # Site configuration
├── assets/ # CSS, JS, images
└── index.md # Homepage
Posts use a specific naming convention: YYYY-MM-DD-title.md. Jekyll reads the date from the filename and uses it for sorting and URL generation.
Phoenix — Real-Time Elixir
Phoenix is the web framework for Elixir, a language that runs on the Erlang VM. It's designed for applications that need to handle massive numbers of simultaneous connections — chat systems, live dashboards, collaborative tools, IoT. Phoenix's LiveView feature lets you build interactive UIs without writing JavaScript.
# Install Phoenix (requires Elixir)
mix archive.install hex phx_new
# Create a new project
mix phx.new my_app
cd my_app
# Setup database
mix ecto.create
# Start the server
mix phx.server
# => Running MyAppWeb.Endpoint at http://localhost:4000
# Interactive mode (Elixir shell + server)
iex -S mix phx.server
Change Port
# Jekyll
bundle exec jekyll serve --port 3000
# Phoenix — config/dev.exs
config :my_app, MyAppWeb.Endpoint,
http: [port: 3000]
# Phoenix via environment
PORT=3000 mix phx.server
Troubleshooting
Jekyll "bundler not found": Install Ruby first (rbenv or rvm recommended), then gem install bundler. On macOS, don't use the system Ruby — it causes permission issues.
Jekyll build is slow: Large sites with hundreds of posts can take 10+ seconds to regenerate. Use --incremental flag for faster rebuilds that only regenerate changed files.
Phoenix "Postgrex connection refused": Phoenix uses PostgreSQL by default. Make sure Postgres is running on port 5432 and the development database exists (mix ecto.create).