|
| 1 | +# Getting Started |
| 2 | + |
| 3 | +## Installation |
| 4 | + |
| 5 | +Installation instructions for installing from source for different operating |
| 6 | +systems can be found [on the forum](https://community.octoprint.org/tags/c/support/guides/15/setup). |
| 7 | + |
| 8 | +If you want to run OctoPrint on a Raspberry Pi, you really should take a look at [OctoPi](https://github.com/guysoft/OctoPi) |
| 9 | +which is a custom SD card image that includes OctoPrint plus dependencies. |
| 10 | + |
| 11 | +The generic steps that should basically be done regardless of operating system |
| 12 | +and runtime environment are the following (as *regular |
| 13 | +user*, please keep your hands *off* of the `sudo` command here!) - this assumes |
| 14 | +you already have Python 3.9+, pip and virtualenv and their dependencies set up on your system: |
| 15 | + |
| 16 | +1. Create a user-owned virtual environment therein: `virtualenv venv`. If you want to specify a specific python |
| 17 | + to use instead of whatever version your system defaults to, you can also explicitly require that via the `--python` |
| 18 | + parameter, e.g. `virtualenv --python=python3 venv`. |
| 19 | +2. Install OctoPrint *into that virtual environment*: `./venv/bin/pip install OctoPrint` |
| 20 | + |
| 21 | +You may then start the OctoPrint server via `/path/to/OctoPrint/venv/bin/octoprint`, see [Usage](#usage) |
| 22 | +for details. |
| 23 | + |
| 24 | +After installation, please make sure you follow the first-run wizard and set up |
| 25 | +access control as necessary. |
| 26 | + |
| 27 | +## Dependencies |
| 28 | + |
| 29 | +OctoPrint depends on a few python modules to do its job. Those are automatically installed when installing |
| 30 | +OctoPrint via `pip`. |
| 31 | + |
| 32 | +OctoPrint currently supports Python 3.9, 3.10, 3.11, 3.12 and 3.13. |
| 33 | + |
| 34 | +## Usage |
| 35 | + |
| 36 | +Running the pip install via |
| 37 | + |
| 38 | + pip install OctoPrint |
| 39 | + |
| 40 | +installs the `octoprint` script in your Python installation's scripts folder |
| 41 | +(which, depending on whether you installed OctoPrint globally or into a virtual env, will be in your `PATH` or not). The |
| 42 | +following usage examples assume that the `octoprint` script is on your `PATH`. |
| 43 | + |
| 44 | +You can start the server via |
| 45 | + |
| 46 | + octoprint serve |
| 47 | + |
| 48 | +By default it binds to all interfaces on port 5000 (so pointing your browser to `http://127.0.0.1:5000` |
| 49 | +will do the trick). If you want to change that, use the additional command line parameters `host` and `port`, |
| 50 | +which accept the host ip to bind to and the numeric port number respectively. If for example you want the server |
| 51 | +to only listen on the local interface on port 8080, the command line would be |
| 52 | + |
| 53 | + octoprint serve --host=127.0.0.1 --port=8080 |
| 54 | + |
| 55 | +Alternatively, the host and port on which to bind can be defined via the config file. |
| 56 | + |
| 57 | +If you want to run OctoPrint as a daemon (only supported on Linux), use |
| 58 | + |
| 59 | + octoprint daemon {start|stop|restart} [--pid PIDFILE] |
| 60 | + |
| 61 | +If you do not supply a custom pidfile location via `--pid PIDFILE`, it will be created at `/tmp/octoprint.pid`. |
| 62 | + |
| 63 | +You can also specify the config file or the base directory (for basing off the `uploads`, `timelapse` and `logs` folders), |
| 64 | +e.g.: |
| 65 | + |
| 66 | + octoprint serve --config /path/to/another/config.yaml --basedir /path/to/my/basedir |
| 67 | + |
| 68 | +To start OctoPrint in safe mode - which disables all third party plugins that do not come bundled with OctoPrint - use |
| 69 | +the ``--safe`` flag: |
| 70 | + |
| 71 | + octoprint serve --safe |
| 72 | + |
| 73 | +See `octoprint --help` for more information on the available command line parameters. |
| 74 | + |
| 75 | +OctoPrint also ships with a `run` script in its source directory. You can invoke it to start the server. It |
| 76 | +takes the same command line arguments as the `octoprint` script. |
| 77 | + |
| 78 | +## Configuration |
| 79 | + |
| 80 | +If not specified via the command line, the config file `config.yaml` for OctoPrint is expected in the settings folder, |
| 81 | +which is located at `~/.octoprint` on Linux, at `%APPDATA%/OctoPrint` on Windows and |
| 82 | +at `~/Library/Application Support/OctoPrint` on MacOS. |
| 83 | + |
| 84 | +A comprehensive overview of all available configuration settings can be found |
| 85 | +[in the configuration docs](configuration/config_yaml). |
| 86 | + |
| 87 | +Please note that the most commonly used configuration settings can also easily |
| 88 | +be edited from OctoPrint's settings dialog. |
0 commit comments