The uncapacitated facility location problem (UFLP) is one of the most widely studied location problems in combinatorial optimization. The UFLP seeks to determine a set of facilities to be opened such that all customers are serviced by a facility and the sum of the fixed costs of opening and operating the facilities and the variable costs of supplying the customers from the opened facilities is minimized. Since UFLP is NP-hard problem, solving large-scale problems is very time-consuming. Therefore, metaheuristics such as simulated annealing (SA), tabu search (TS), genetic algorithms (GA) and ant colony optimization (ACO) have gained considerable attention to solve this kind of complex optimization problems. In this paper, we propose a heuristic algorithm based on ant colony optimization, called ufl_ACO, to solve the UFLP. The performance of the proposed heuristic algorithm, which is the first application of ACO to the UFLP, is investigated using benchmark problems and compared with other heuristic, algorithms in the literature. The computational analysis indicates that ufl_ACO is an effective and efficient for the UFLP and competitive with other heuristic algorithms.