Silex is zero-config to start and can be extended with flexible configuration options.
Zero config was inspired by 11ty and it means that Silex can run without any command line parameters or configuration files.
We’ve taken care to setup Silex so that running the silex
command uses sensible defaults. Lower the barrier to entry for that first project to get up and running faster.
You may be interested in this project: Silex edition with a dashboard for multi-sites and other useful options. It is used for v3.silex.me free instance.
If you are planing to contribute code to Silex, you will need to run Silex from source, please check this guide about how to contribute
Requirements
Silex is available as a one click app for Caprover
This is convenient as you can go further by also self hosting GitLab and a CMS such as WordPres, as they are available as one click apps too.
OS | Supported | Tester |
---|---|---|
Linux (Fedora) | ✓ | @lexoyo |
Windows | ? | |
MacOS | ? | |
Other | ? |
Requirements
Use Silex official docker image
$ docker run -p 6805:6805 silexlabs/silex
Then open http://localhost:6805
The default options can be overriden with environment variables using the -e
option in docker run, see the list of all available options
$ docker run -p 8080:8080 -e PORT=8080 silexlabs/silex
In order to add plugins and configure Silex with config files (client and server), check the section "Start with a custom config file" bellow.
OS | Supported | Tester |
---|---|---|
Linux (Fedora) | ✓ | @lexoyo |
Windows | ? | |
MacOs | ? | |
Other | ? |
Requirements
Install and launch Silex from the command line with the following command:
npx @silexlabs/silex
Then open http://localhost:6805
The CLI supports a number of options, allowing you to customize Silex's behavior, see the list of options here
To use these options, simply append them to the command line when launching Silex. For example:
npx @silexlabs/silex --port=8000 --debug=true
This would start Silex, listening on port 8000, with debug mode enabled.
If you want to install Silex globally with npm, you can do so with the following command:
npm install -g @silexlabs/silex
This command tells npm to install the package '@silexlabs/silex' globally (-g
flag), which means you can use it from any directory on your machine.
After installing Silex globally, you can launch it from anywhere with:
silex
Just like when using npx, you can also pass command-line options when launching Silex:
silex --port=8000 --debug=true
This will start Silex, listening on port 8000, with debug mode enabled.
Or you can use the environment variables of your OS too set the options
$ PORT=8080 npx @silexlabs/silex
Which is equivalent to this with Silex globally installed (npm install -g @silexlabs/silex
)
$ PORT=8080 silex
You can configure Silex using environment variables and command-line options. All available options can be found in the docs about options. Also you can read more about Silex configuration here
There are config files (same as plugins) in the examples/
folder of Silex repository. To start Silex locally with these config:
docker run -p 6805:6805 \
-v $(pwd)/examples/client-config-transformers.js:/app/examples/client-config-transformers.js \
-v $(pwd)/examples/server-config-plugins.js:/app/examples/server-config-plugins.js \
-e SILEX_CLIENT_CONFIG=/path/to/client-config.js \
-e SILEX_SERVER_CONFIG=/path/to/server-config.js \
silexlabs/silex
Or with npx
$ SILEX_CLIENT_CONFIG=/path/to/client-config.js SILEX_SERVER_CONFIG=/path/to/server-config.js npx @silexlabs/silex