# OctoPrint Setup
There are a few pre-requisites for OctoPrint to allow OctoFarm to establish a reliable connection to OctoPrint. Please setup the below on each instance you want to add to your farm.
WARNING
Multi-User OctoPrint Setups
Post-V1.2 - To save time when adding printers to OctoFarm will attempt to guess the user you want to use on it with OctoPrints connection. This guess isn't amazingly smart, it just expects a single user administrator setup so will always pick your first created user. If you've got multiple users on your system, it is recommended to create a new administrator called "octofarm" or "OctoFarm" if you like camelcase. OctoFarm will detect this user name and default back to it. Failing this, OctoFarm will not be able to connect due to the mis-match in authentication keys and username. You may open up the settings for your printer and change the user there in the Printer Manager screen.
# Setup the correct API Key
There are 3 different types of API keys in OctoPrint.
- User API Key (useful). The user API key works only if the user has the groups Admins and Operator. This is the first user you make, so make sure to add the roles yourself for it to work for another user (if you must).
- Application Key (useful). The same as a User key but targeted for specific applications: like OctoFarm. Make sure your user has the groups ADMINS AND OPERATOR for your user - this is default for only the 1st user!
- Global API Key. This key does not work with authorising the websocket connection in OctoPrint anymore. It can't be used, and OctoPrint will be removing it in a future version.
Quoting OctoPrint's Application Key page:
The global API key should best not be used anymore. It's one single key that gives full admin access to your whole OctoPrint instance. Instead of using it you should create individual Application Keys for your third party clients. That way they get permissions matching the user account used for key creation and you can also revoke access to one app without having to change the keys for all other apps. It's also recommended to create a user account without admin access and use that for third party clients where possible.
TL;DR create an Application Key for the first OctoPrint account you made ❤️ This the way to get there:
- Settings wrench icon
- Application Key (side navigation within OctoPrint Settings)
- Copy the generated key in the
Registered application keys
field which will appear after you clickGenerate
TIP
- (Optional) you can do this also in the User Settings, where the same Application Key are managed but only for the user itself, as well as also a user-specific API Key can be generated. Pretty confusing, yeah. Just use Application Key.
# Make sure your user has Administrator Privileges
TIP
- (Optional) make sure the user has Operator and Admins groups (which is default for the first user).
OctoPrint Settings (wrench icon) > Access Control > Edit the user you want (crayon icon)