The firefly algorithm is applied to the uncapacitated facility location problem which is a well known optimization problem. The light absorption coefficient parameter γ of the firefly algorithm is examined to obtain better performance and suitable values of γ are explored for the uncapacitated facility location problem. Effectiveness of local search in the firefly algorithm is also investigated. In addition, the firefly algorithm equipped with local search is compared with the artificial bee colony algorithm with respect to average relative percent error and hit to optimum rate.