# Docsify: Self-Hosted Setup on Apache 2
A complete guide to running Docsify on Apache 2 with no external CDN dependencies. We follow the [manual creation](https://docsify.js.org/#/quickstart?id=manual-initialization) but download the JavaScript and CSS files locally so we don't have to worry if the domain cdn.jsdelivr.net get seized (who knows what's going to happen in the future).
---
## Prerequisites
- Apache 2.4+
- `curl` (for downloading assets)
---
## Directory Structure
The final layout this guide produces, relative to your document root:
```
./
├── index.html ← Docsify entry point
├── README.md ← Homepage content
├── _sidebar.md ← Sidebar navigation
├── getting-started.md ← Example page
└── assets/
├── js/
│ ├── docsify.min.js
│ └── search.min.js
└── css/
└── vue.css
```
All commands in this guide assume you have already `cd`'d into your document root.
---
## Step 1: Create the Directory Structure
```bash
mkdir -p assets/js
mkdir -p assets/css
```
---
## Step 2: Download Docsify Assets
All files are downloaded from jsDelivr once and served locally thereafter. See all [docsify CDN files](https://cdn.jsdelivr.net/npm/docsify@4/lib/) on jsDelivr.
```bash
# Docsify core
curl -L "https://cdn.jsdelivr.net/npm/docsify@4/lib/docsify.min.js" \
-o assets/js/docsify.min.js
# Search plugin
curl -L "https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/search.min.js" \
-o assets/js/search.min.js
# Theme (Vue — clean, light)
curl -L "https://cdn.jsdelivr.net/npm/docsify@4/themes/vue.css" \
-o assets/css/vue.css
```
### Alternative Themes
Replace `vue.css` in the command above with any of the following if preferred; see all [themes](https://cdn.jsdelivr.net/npm/docsify@4.13.1/lib/themes/).
* buble.css
* dark.css
* dolphin.css
* pure.css
* vue.css
### Optional: Syntax Highlighting
If your documentation includes fenced code blocks, download Prism and the language components you need:
```bash
# Prism core (required)
curl -L "https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-core.min.js" \
-o assets/js/prism-core.min.js
# Language components — add as many as needed
curl -L "https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-bash.min.js" \
-o assets/js/prism-bash.min.js
curl -L "https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-yaml.min.js" \
-o assets/js/prism-yaml.min.js
curl -L "https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-javascript.min.js" \
-o assets/js/prism-javascript.min.js
```
Then add each `