This paper presents an immune-inspired technique for optimizing a server energy consumption. The proposed technique is similar with an artificial immune system associated to a server, aiming to detect non-optimal server energy consumption states and to take the appropriate actions that would bring the server into an optimal state. The optimization technique has two main stages: an initialization stage and a self-optimization stage. In the initialization stage the server is monitored for a specific period of time to collect energy consumption historical raw data for identifying associations between the server energy consumption states and the appropriate optimization actions. In the selfoptimization stage, energy consumption server state snapshots are taken at regular time intervals and formally represented using a biologically-inspired antigen model. The obtained antigen is then classified as self (optimal energy consumption state) or non-self (non-optimal energy consumption state) using a set of detectors obtained in the initialization stage. For non-self antigens a biologically-inspired clonal selection approach is used to determine the actions that need to be taken to bring the server in an optimal energy consumption state.