Autonomous system has an increasingly important role in small-scale urban agriculture. It has the potential to enable people without professional agricultural skills to utilize the under-exploited urban space on top of, or between the urban buildings to increase food production. It is important for global food security given the background of increasing global population and decreasing total arable land in the future. The aim of this research is to propose the classical planning approach to automate an existing low-cost robotic platform: Farmbot, which is designed for small-scale backyard farming and evaluate the feasibility of this approach. Specifically, we first propose the appropriate planning domain and problems on Farmbot using the planning domain definition language (PDDL) to allow the common tasks on the Farmbot to be achieved by automatically generated plans. Then, we explore the meaningful way to apply plan metric in order to optimize those plans. Later, we propose an agent planning program, which enables the automatic formulation of a sequence of planning problems and continuous plan generation over the planning domain on Farmbot. A ROS project is developed to incorporate these planning components with a controlling interface to enable plan dispatching and execution. The results and evaluation from multiple experiments, including a benchmarking and a simulation show the feasibility of such an approach and also validate our PDDL modelling, our agent planning program, the approach we apply plan metric to optimize the plans and the entire system in the ROS project. This project introduces a new research problem and increases the uptake of planning technology in real-world problems, most importantly it opens up many options and opportunities for future research topics.