localhost:4000
Port 4000 is the default port for Jekyll (Ruby static site generator) and Phoenix Framework (Elixir). If you're building a Jekyll blog, GitHub Pages site, or Phoenix web application, this is your development URL.
Open dev server:
http://localhost:4000
Default for: Jekyll | Phoenix | Gatsby (serve) | Docusaurus
What Uses Port 4000?
| Tool | Language | Start Command |
|---|---|---|
| Jekyll | Ruby | jekyll serve |
| Phoenix | Elixir | mix phx.server |
| Gatsby | JavaScript | gatsby serve |
| Docusaurus | JavaScript | npm run serve |
| Hugo | Go | hugo server -p 4000 |
Jekyll Development
Jekyll powers GitHub Pages and is one of the most popular static site generators.
# Install Jekyll
gem install jekyll bundler
# Create new site
jekyll new my-blog
cd my-blog
# Start development server
bundle exec jekyll serve
# With live reload
bundle exec jekyll serve --livereload
# Access at http://localhost:4000
Jekyll Configuration
# _config.yml - change port
port: 4000
host: localhost
livereload: true
# Or via command line
jekyll serve --port 4001
Phoenix Framework
Phoenix is an Elixir web framework known for real-time features and performance.
# Create new Phoenix app
mix phx.new my_app
cd my_app
# Setup database
mix ecto.create
# Start server
mix phx.server
# Access at http://localhost:4000
Phoenix Configuration
# config/dev.exs
config :my_app, MyAppWeb.Endpoint,
http: [port: 4000],
debug_errors: true,
code_reloader: true
Change Default Port
# Jekyll
jekyll serve --port 4001
# Phoenix (environment variable)
PORT=4001 mix phx.server
# Gatsby
gatsby serve --port 4001
Troubleshooting
| Problem | Solution |
|---|---|
| Port in use | Use --port 4001 or kill process |
| Jekyll not found | gem install jekyll bundler |
| Permission denied | Fix gem permissions, don't use sudo |
| Page not updating | Enable livereload or restart server |