Table of Contents
Deploying your Jekyll site is the final step to make it live on the internet. There are several excellent options available, each with their own advantages. This guide covers the most popular deployment methods.
Prerequisites
Before deploying, ensure your Jekyll site is ready:
- Test locally first:
bundle exec jekyll serve
- Build the site:
bundle exec jekyll build
- Check the
_site
folder - this contains your built site ready for deployment.
Deployment Methods
1. GitHub Pages (Recommended for Beginners)
GitHub Pages is perfect for beginners and offers free hosting for Jekyll sites.
- Create a GitHub repository with your Jekyll site
- Push your code to the repository
-
Enable GitHub Pages:
- Go to Settings → Pages
- Select source branch (usually
main
ormaster
) - Choose folder (
/
for root or/docs
)
- Configure Jekyll for GitHub Pages:
# _config.yml baseurl: "/your-repo-name" url: "https://yourusername.github.io"
2. Netlify (Recommended)
Netlify offers more flexibility and features than GitHub Pages.
-
Connect your repository:
- Sign up at netlify.com
- Click “New site from Git”
- Connect your GitHub/GitLab/Bitbucket account
-
Configure build settings:
Build command: bundle exec jekyll build Publish directory: _site
-
Deploy automatically - every push to your main branch triggers a new deployment
3. Vercel (Modern Alternative)
Vercel is excellent for modern web development workflows.
-
Install Vercel CLI:
npm i -g vercel
-
Deploy with one command:
vercel
-
Follow the prompts to connect your repository
4. Manual Deployment
For complete control, you can manually upload your built site.
-
Build your site:
bundle exec jekyll build
-
Upload
_site
contents to your web server via FTP/SFTP -
Configure your web server to serve static files
Advanced Configuration
Custom Domains
Most platforms support custom domains:
- Purchase a domain from a registrar
- Add DNS records as instructed by your hosting platform
- Configure in your hosting platform’s settings
Build Optimization
Optimize your builds for faster deployment:
# _config.yml
exclude:
- node_modules
- .git
- README.md
Troubleshooting Common Issues
Build Failures
Problem: Site won’t build on deployment platform Solution:
- Test locally first:
bundle exec jekyll build
- Check for unsupported plugins
- Verify
_config.yml
syntax
Missing Assets
Problem: Images/CSS not loading Solution:
- Check file paths (use relative URLs)
- Ensure assets are in the correct folders
- Verify
baseurl
setting
Custom Domain Issues
Problem: Custom domain not working Solution:
- Wait for DNS propagation (up to 48 hours)
- Check DNS records are correct
- Verify SSL certificate is active
Best Practices
- Always test locally before deploying
- Use version control for your site
- Set up automatic deployments
- Monitor your site after deployment
- Keep backups of your content
- Document your deployment process
Conclusion
Choose your deployment method based on your needs:
- GitHub Pages: Great for beginners and simple sites
- Netlify: Best for advanced features and flexibility
- Vercel: Excellent for modern development workflows
- Manual: For complete control and custom requirements
Remember to test thoroughly and monitor your site after deployment. Most issues can be resolved by checking the build logs and testing locally first.
For more detailed guides on specific platforms, check out their official documentation: